diff --git a/pkg/os/process/process_execution/process_execution.go b/pkg/os/process/process_execution/process_execution.go index 68fb90a..5e488d8 100644 --- a/pkg/os/process/process_execution/process_execution.go +++ b/pkg/os/process/process_execution/process_execution.go @@ -3,7 +3,17 @@ package process_execution import "os/exec" func ExecuteAndGetOutput(command string, args ...string) (string, error) { - outputBytes, err := exec.Command(command, args...).CombinedOutput() + return ExecuteAndGetOutputC(nil, command, args...) +} + +func ExecuteAndGetOutputC(cfg func(*exec.Cmd), command string, args ...string) (string, error) { + process := exec.Command(command, args...) + + if cfg != nil { + cfg(process) + } + + outputBytes, err := process.CombinedOutput() outputString := "" if outputBytes != nil && len(outputBytes) > 0 {