shdir

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec

func Exec(dir string, env map[string]string, stdout, stderr io.Writer, cmd string, args ...string) (ran bool, err error)

Exec executes the command, piping its stdout and stderr to the given writers. If the command fails, it will return an error that, if returned from a target or mg.Deps call, will cause mage to exit with the same code as the command failed with. Env is a list of environment variables to set when running the command, these override the current environment variables set (which are also passed to the command). cmd and args may include references to environment variables in $FOO format, in which case these will be expanded before the command is run.

Ran reports if the command ran (rather than was not found or not executable). Code reports the exit code the command returned if it ran. If err == nil, ran is always true and code is always 0.

func RunWith

func RunWith(dir string, env map[string]string, cmd string, args ...string) error

RunWith runs the given command, directing stderr to this program's stderr and printing stdout to stdout if mage was run with -v. It adds adds env to the environment variables for the command being run. Environment variables should be in the format name=value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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