bash

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

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

func RunBashScriptFromFile(ctx context.Context, runner *interp.Runner, filePath string) error

RunBashScriptFromFile parses and runs a bash script from a file. The script is executed in the provided runner (not a subshell).

func RunBashScriptFromReader

func RunBashScriptFromReader(ctx context.Context, runner *interp.Runner, reader io.Reader, name string) error

RunBashScriptFromReader parses and runs a bash script from an io.Reader. The script is executed in the provided runner (not a subshell).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL