Skip to content

ngtrimble/executil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

executil

Introduction

This package provides some convenient wrappers around os/exec. Specifically it solves the problem of running external processes until they complete while continously streaming stdout and stderr to an io.Writer of your choice. This package also makes piping other commands in sequence convenient.

Docs

Read docs on https://godoc.org/github.com/ngtrimble/executil

Examples

cmd1 := exec.Command("echo", "hello world")
cmd2 := exec.Command("cat")
stdout, stderr, err := StartWaitPipe(nil, cmd1, cmd2)
if err != nil {
    fmt.Fprintf(os.Stderr, "%v", err)
} else {
    fmt.Printf("%s", stdout)
}

This is equivalent to running the following in the a shell

echo "hello world" | cat

Run all tests recursively with stdout and stderr output to shell

go test ./... -v

About

A wrapper utility around os/exec

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published