pkger/here/here.go

26 lines
359 B
Go
Raw Normal View History

2019-08-05 00:13:27 +03:00
package here
import (
"bytes"
"os"
"os/exec"
"github.com/markbates/pkger/internal/debug"
)
func run(n string, args ...string) ([]byte, error) {
c := exec.Command(n, args...)
debug.Debug("[HERE] %s", c.Args)
bb := &bytes.Buffer{}
c.Stdout = bb
c.Stderr = os.Stderr
err := c.Run()
if err != nil {
return nil, err
}
return bb.Bytes(), nil
}