refactor: remove all calls to common.NewShellCmd

At this point, the only usage of go-sh should be by plugin trigger calls.
This commit is contained in:
Jose Diaz-Gonzalez
2024-02-13 01:09:24 -05:00
parent 24b32432e6
commit 44dd933638
10 changed files with 207 additions and 234 deletions

View File

@@ -38,15 +38,16 @@ func Copy(src, dst string) error {
}
// ensure file has the correct line endings
dos2unixCmd := NewShellCmd(strings.Join([]string{
"dos2unix",
"-l",
"-n",
src,
dst,
}, " "))
dos2unixCmd.ShowOutput = false
dos2unixCmd.Execute()
result, err := CallExecCommand(ExecCommandInput{
Command: "dos2unix",
Args: []string{"-l", "-n", src, dst},
})
if err != nil {
return fmt.Errorf("Error running dos2unix: %s", err)
}
if result.ExitCode != 0 {
return fmt.Errorf("Error running dos2unix: %s", result.StderrContents())
}
// ensure file permissions are correct
b, err := os.ReadFile(dst)