Documentation ¶
Index ¶
- type PipedCmd
- func (p *PipedCmd) Execute(ctx context.Context, stdin io.Reader, stdout io.Writer, stderr io.Writer) error
- func (p *PipedCmd) Pipe(cmd string, args ...string) *PipedCmd
- func (p *PipedCmd) PipeTo(into *PipedCmd) *PipedCmd
- func (p *PipedCmd) Run(ctx context.Context) error
- func (p *PipedCmd) Shell(fullLine string) *PipedCmd
- func (p *PipedCmd) WithDir(d string) *PipedCmd
- func (p *PipedCmd) WithEnv(e []string) *PipedCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PipedCmd ¶
type PipedCmd struct {
// contains filtered or unexported fields
}
func Shell ¶ added in v0.0.6
Shell tries to be like the *sh shell to create a piped command. It will, after splitting the string, run os.Expand on the parts. It works correctly for things like this
Shell("echo hi") Shell("GOOS=linux go build") Shell("docker run -it ubuntu") Shell("docker run -v $HOME/.aws:/root/.aws:ro ubuntu")
It will not work like bash for things like this
Shell("echo '$HOME'")
Since it will first split echo into $HOME, and then escape the HOME
func ShellWithError ¶ added in v0.0.6
Click to show internal directories.
Click to hide internal directories.