parent
543a653864
commit
fcbd6aff29
|
|
@ -1,8 +1,6 @@
|
||||||
package helmexec
|
package helmexec
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
|
||||||
"os/exec"
|
"os/exec"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -21,13 +19,6 @@ type ShellRunner struct{}
|
||||||
|
|
||||||
// Execute a shell command
|
// Execute a shell command
|
||||||
func (shell ShellRunner) Execute(cmd string, args []string) ([]byte, error) {
|
func (shell ShellRunner) Execute(cmd string, args []string) ([]byte, error) {
|
||||||
dir, err := ioutil.TempDir("", tmpPrefix+cmd+tmpSuffix)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer os.RemoveAll(dir)
|
|
||||||
|
|
||||||
preparedCmd := exec.Command(cmd, args...)
|
preparedCmd := exec.Command(cmd, args...)
|
||||||
preparedCmd.Dir = dir
|
|
||||||
return preparedCmd.CombinedOutput()
|
return preparedCmd.CombinedOutput()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue