Log when directory is changed

This commit is contained in:
Jesse Duffield 2023-07-16 18:12:26 +10:00
parent 6b4a638415
commit ae0193698e
5 changed files with 21 additions and 6 deletions

View file

@ -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