summaryrefslogtreecommitdiffstats
path: root/pkg/commands/oscommands/cmd_obj.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/commands/oscommands/cmd_obj.go')
-rw-r--r--pkg/commands/oscommands/cmd_obj.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/commands/oscommands/cmd_obj.go b/pkg/commands/oscommands/cmd_obj.go
index 520a76a1b..d1cc23c67 100644
--- a/pkg/commands/oscommands/cmd_obj.go
+++ b/pkg/commands/oscommands/cmd_obj.go
@@ -24,6 +24,9 @@ type ICmdObj interface {
AddEnvVars(...string) ICmdObj
GetEnvVars() []string
+ // sets the working directory
+ SetWd(string) ICmdObj
+
// runs the command and returns an error if any
Run() error
// runs the command and returns the output as a string, and an error if any
@@ -142,6 +145,12 @@ func (self *CmdObj) GetEnvVars() []string {
return self.cmd.Env
}
+func (self *CmdObj) SetWd(wd string) ICmdObj {
+ self.cmd.Dir = wd
+
+ return self
+}
+
func (self *CmdObj) DontLog() ICmdObj {
self.dontLog = true
return self