execute

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecResult

type ExecResult struct {
	Stdout    string
	Stderr    string
	ExitCode  int
	Cancelled bool
}

type ExecTask

type ExecTask struct {
	// Command is the command to execute. This can be the path to an executable
	// or the executable with arguments. The arguments are detected by looking for
	// a space.
	//
	// Examples:
	//  - Just a binary executable: `/bin/ls`
	//  - Binary executable with arguments: `/bin/ls -la /`
	Command string
	// Args are the arguments to pass to the command. These are ignored if the
	// Command contains arguments.
	Args []string
	// Shell run the command in a bash shell.
	// Note that the system must have `/bin/bash` installed.
	Shell bool
	// Env is a list of environment variables to add to the current environment,
	// these are used to override any existing environment variables.
	Env []string
	// Cwd is the working directory for the command
	Cwd string

	// Stdin connect a reader to stdin for the command
	// being executed.
	Stdin io.Reader

	// StreamStdio prints stdout and stderr directly to os.Stdout/err as
	// the command runs.
	StreamStdio bool

	// PrintCommand prints the command before executing
	PrintCommand bool
}

func (ExecTask) Execute

func (et ExecTask) Execute(ctx context.Context) (ExecResult, error)

Jump to

Keyboard shortcuts

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