chore: remove all direct usage of go-sh outside of plugin trigger setup

The new way is to use CallExecCommand instead.
This commit is contained in:
Jose Diaz-Gonzalez committed 2024-02-12 19:29:16 -05:00
1 parent 688ee518af
commit 8a940c6e47
11 files changed
+99 -99

No files matched your search

+11 -3
View File
@@ -9,7 +9,6 @@ import (
"strconv"
"strings"
sh "github.com/codeskyblue/go-sh"
"github.com/dokku/dokku/plugins/common"
"github.com/dokku/dokku/plugins/config"
dockeroptions "github.com/dokku/dokku/plugins/docker-options"
@@ -103,8 +102,17 @@ func TriggerCorePostExtract(appName string, sourceWorkDir string) error {
}
}
if b, err := sh.Command("procfile-util", "check", "-P", processSpecificProcfile).CombinedOutput(); err != nil {
return fmt.Errorf(strings.TrimSpace(string(b[:])))
result, err := common.CallExecCommand(common.ExecCommandInput{
Command: "procfile-util",
Args: []string{"check", "-P", processSpecificProcfile},
CaptureOutput: true,
StreamStdio: false,
})
if err != nil {
return fmt.Errorf(result.StderrContents())
}
if result.ExitCode != 0 {
return fmt.Errorf("Invalid Procfile: %s", result.StderrContents())
}
return nil
}