Files
filebrowser/plugins/utils.go
T

20 lines
305 B
Go
Raw Normal View History

2017-07-29 10:14:34 +01:00
package plugins
2017-07-11 16:58:18 +01:00
import (
2017-07-12 15:28:35 +01:00
"errors"
2017-07-11 16:58:18 +01:00
"os/exec"
)
// Run executes an external command
func Run(command string, args []string, path string) error {
cmd := exec.Command(command, args...)
cmd.Dir = path
2017-07-12 15:28:35 +01:00
out, err := cmd.CombinedOutput()
if err != nil {
return errors.New(string(out))
}
return nil
2017-07-11 16:58:18 +01:00
}