Some updates

Former-commit-id: 85b39b955a07c865e044c0f3153db47136ee4a2b [formerly 138bd8d44abb3b3515a2a2d4a5bded3f01ddb9de] [formerly 947626a88114a591b79b3b3022d1f89f3ad67f78 [formerly 45b4ec5a4392074cb3fda2204420be9135be71cf]]
Former-commit-id: 6f7c3b29f1c21cb26a5690d3b3e183571ebcb413 [formerly 0f604cd52712e918daaaa19b74c077af1e740bb2]
Former-commit-id: adc98f939069cf56180d1ffa10b19daf96696812
This commit is contained in:
Henrique Dias
2017-07-12 15:28:35 +01:00
parent 7a4e2a86e0
commit efdc61f791
5 changed files with 133 additions and 36 deletions

View File

@@ -1,7 +1,7 @@
package hugo
import (
"os"
"errors"
"os/exec"
)
@@ -9,7 +9,11 @@ import (
func Run(command string, args []string, path string) error {
cmd := exec.Command(command, args...)
cmd.Dir = path
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()
out, err := cmd.CombinedOutput()
if err != nil {
return errors.New(string(out))
}
return nil
}