use RunCmd for postup/postdown

This commit is contained in:
Matthew R. Kasun
2022-09-09 14:15:10 -04:00
parent 0ade279ca7
commit 7ec8c4be2a
6 changed files with 30 additions and 24 deletions

View File

@@ -437,6 +437,10 @@ func Copy(src, dst string) error {
func RunCmds(commands []string, printerr bool) error {
var err error
for _, command := range commands {
//prevent panic
if command == " " {
continue
}
args := strings.Fields(command)
out, err := exec.Command(args[0], args[1:]...).CombinedOutput()
if err != nil && printerr {