summaryrefslogtreecommitdiffstats
path: root/pkg/commands/os.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/commands/os.go')
-rw-r--r--pkg/commands/os.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/commands/os.go b/pkg/commands/os.go
index b6ef1a07f..44202e003 100644
--- a/pkg/commands/os.go
+++ b/pkg/commands/os.go
@@ -50,6 +50,12 @@ func NewOSCommand(log *logrus.Entry, config config.AppConfigurer) *OSCommand {
}
}
+// SetCommand sets the command function used by the struct.
+// To be used for testing only
+func (c *OSCommand) SetCommand(cmd func(string, ...string) *exec.Cmd) {
+ c.command = cmd
+}
+
// RunCommandWithOutput wrapper around commands returning their output and error
func (c *OSCommand) RunCommandWithOutput(command string) (string, error) {
c.Log.WithField("command", command).Info("RunCommand")