Version: v0.0.0-...-496099c Latest Latest

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 7 Imported by: 1



Package cmd is DEPRECATED. Please use or os/exec directly.



This section is empty.


View Source
var (
	RunCommand            = runCommand
	RunCommands           = runCommands
	RunCommandsInParallel = runCommandsInParallel

These vars are defined for easy mocking in unit tests.


This section is empty.


type CommandLineError

type CommandLineError struct {
	Command     string
	ErrorCode   int
	ErrorOutput []byte

CommandLineError is a custom error we use for errors got from running commands

func (CommandLineError) Error

func (c CommandLineError) Error() string

type Option

type Option func(cmd *exec.Cmd)

Option enables further configuration of a Cmd.

func WithDir

func WithDir(dir string) Option

WithDir returns an option that adds dir for the given Cmd.

func WithEnvs

func WithEnvs(envs []string) Option

WithEnvs returns an option that adds env vars for the given Cmd.

func WithStdout

func WithStdout() Option

WithStdout returns an option that sets the cmd output to stdout. This redirects output to stdout, should not use this option if you need the return value of the command.

Jump to

Keyboard shortcuts

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