Documentation
¶
Index ¶
- Constants
- func ExplainError(err error) string
- func GetExitCode(err error) (int, error)
- func GitTopLevelDir(terragruntOptions *options.TerragruntOptions, path string) (string, error)
- func PrepareConsole(terragruntOptions *options.TerragruntOptions)
- func PromptUserForInput(prompt string, terragruntOptions *options.TerragruntOptions) (string, error)
- func PromptUserForYesNo(prompt string, terragruntOptions *options.TerragruntOptions) (bool, error)
- func RunShellCommand(terragruntOptions *options.TerragruntOptions, command string, args ...string) error
- func RunTerraformCommand(terragruntOptions *options.TerragruntOptions, args ...string) error
- type CmdOutput
- type ProcessExecutionError
- type SignalsForwarder
Constants ¶
const InvalidHandleErrorMessage = "The handle is invalid"
Variables ¶
This section is empty.
Functions ¶
func ExplainError ¶
ExplainError will try to explain the error to the user, if we know how to do so.
func GetExitCode ¶
Return the exit code of a command. If the error does not implement iErrorCode or is not an exec.ExitError or *multierror.Error type, the error is returned.
func GitTopLevelDir ¶
func GitTopLevelDir(terragruntOptions *options.TerragruntOptions, path string) (string, error)
GitTopLevelDir - fetch git repository path from passed directory
func PrepareConsole ¶
func PrepareConsole(terragruntOptions *options.TerragruntOptions)
PrepareConsole enables support for escape sequences https://stackoverflow.com/questions/56460651/golang-fmt-print-033c-and-fmt-print-x1bc-are-not-clearing-screenansi-es https://github.com/containerd/console/blob/f652dc3/console_windows.go#L46
func PromptUserForInput ¶
func PromptUserForInput(prompt string, terragruntOptions *options.TerragruntOptions) (string, error)
Prompt the user for text in the CLI. Returns the text entered by the user.
func PromptUserForYesNo ¶
func PromptUserForYesNo(prompt string, terragruntOptions *options.TerragruntOptions) (bool, error)
Prompt the user for a yes/no response and return true if they entered yes.
func RunShellCommand ¶
func RunShellCommand(terragruntOptions *options.TerragruntOptions, command string, args ...string) error
Run the given shell command
func RunTerraformCommand ¶
func RunTerraformCommand(terragruntOptions *options.TerragruntOptions, args ...string) error
Run the given Terraform command
Types ¶
type CmdOutput ¶
func RunShellCommandWithOutput ¶
func RunShellCommandWithOutput( terragruntOptions *options.TerragruntOptions, workingDir string, suppressStdout bool, allocatePseudoTty bool, command string, args ...string, ) (*CmdOutput, error)
Run the specified shell command with the specified arguments. Connect the command's stdin, stdout, and stderr to the currently running app. The command can be executed in a custom working directory by using the parameter `workingDir`. Terragrunt working directory will be assumed if empty string.
func RunTerraformCommandWithOutput ¶
func RunTerraformCommandWithOutput(terragruntOptions *options.TerragruntOptions, args ...string) (*CmdOutput, error)
Run the given Terraform command, writing its stdout/stderr to the terminal AND returning stdout/stderr to this method's caller
type ProcessExecutionError ¶
ProcessExecutionError - error returned when a command fails, contains StdOut and StdErr
func (ProcessExecutionError) Error ¶
func (err ProcessExecutionError) Error() string
func (ProcessExecutionError) ExitStatus ¶
func (err ProcessExecutionError) ExitStatus() (int, error)
type SignalsForwarder ¶
func NewSignalsForwarder ¶
func NewSignalsForwarder(signals []os.Signal, c *exec.Cmd, logger *logrus.Entry, cmdChannel chan error) SignalsForwarder
Forwards signals to a command, waiting for the command to finish.
func (*SignalsForwarder) Close ¶
func (signalChannel *SignalsForwarder) Close() error