Documentation
¶
Index ¶
- func RunBashCommand(ctx context.Context, runner *interp.Runner, command string) (string, string, error)
- func RunBashCommandInSubShell(ctx context.Context, runner *interp.Runner, command string) (string, string, error)
- func RunBashCommandInSubShellWithExitCode(ctx context.Context, runner *interp.Runner, command string) (string, string, int, error)
- func RunBashScriptFromFile(ctx context.Context, runner *interp.Runner, filePath string) error
- func RunBashScriptFromReader(ctx context.Context, runner *interp.Runner, reader io.Reader, name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunBashCommand ¶ added in v0.4.0
func RunBashCommand(ctx context.Context, runner *interp.Runner, command string) (string, string, error)
RunBashCommand runs a bash command in the main runner and captures stdout/stderr. WARNING: This temporarily redirects the runner's stdio, which is not thread-safe. Consider using RunBashCommandInSubShell for safer concurrent execution.
func RunBashCommandInSubShell ¶
func RunBashCommandInSubShell(ctx context.Context, runner *interp.Runner, command string) (string, string, error)
RunBashCommandInSubShell runs a bash command in a subshell and captures stdout/stderr. Returns stdout, stderr, and any error. Non-zero exit codes are returned as errors. Deprecated: Use RunBashCommandInSubShellWithExitCode for better exit code handling.
func RunBashCommandInSubShellWithExitCode ¶ added in v1.0.0
func RunBashCommandInSubShellWithExitCode(ctx context.Context, runner *interp.Runner, command string) (string, string, int, error)
RunBashCommandInSubShellWithExitCode runs a bash command in a subshell and captures stdout/stderr. Returns stdout, stderr, exit code, and any execution error. A non-zero exit code is NOT treated as an error - check the exit code separately.
func RunBashScriptFromFile ¶
RunBashScriptFromFile parses and runs a bash script from a file. The script is executed in the provided runner (not a subshell).
Types ¶
This section is empty.