filebrowser/plugins/utils.go
Henrique Dias 0d453229d9 Hugo Updates
Former-commit-id: 35d71feaf1921d3b965331e02ac45274a24e1d5f [formerly 98ad98d2326fee3f4dc318f0597f53688704ecfe] [formerly 0d02b487fd32a169a4f1133e086058f1db3df108 [formerly b863033d7a]]
Former-commit-id: 3fc286e691e56c3ff03b0e50ea89adf586a86789 [formerly 2b4bbc4ce6bab8c69c9baa3653480221a1ff71d2]
Former-commit-id: 83d23b6b60d00b6499729e145074396c7ffbc06d
2017-07-29 10:14:34 +01:00

20 lines
305 B
Go

package plugins
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
}