filebrowser/caddy/hugo/utils.go
Henrique Dias efdc61f791 Some updates
Former-commit-id: 85b39b955a07c865e044c0f3153db47136ee4a2b [formerly 138bd8d44abb3b3515a2a2d4a5bded3f01ddb9de] [formerly 947626a88114a591b79b3b3022d1f89f3ad67f78 [formerly 45b4ec5a43]]
Former-commit-id: 6f7c3b29f1c21cb26a5690d3b3e183571ebcb413 [formerly 0f604cd52712e918daaaa19b74c077af1e740bb2]
Former-commit-id: adc98f939069cf56180d1ffa10b19daf96696812
2017-07-12 15:28:35 +01:00

20 lines
302 B
Go

package hugo
import (
"errors"
"os/exec"
)
// Run executes an external command
func Run(command string, args []string, path string) error {
cmd := exec.Command(command, args...)
cmd.Dir = path
out, err := cmd.CombinedOutput()
if err != nil {
return errors.New(string(out))
}
return nil
}