From c7cf8f40d75d749b00cea6cefff5da8f8ec0f4ff Mon Sep 17 00:00:00 2001 From: Tobias Schmidt Date: Thu, 22 Nov 2018 21:06:46 +0100 Subject: [PATCH] commands can be run in specified folder --- cmd.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd.go b/cmd.go index b1465ff..6ce3db4 100644 --- a/cmd.go +++ b/cmd.go @@ -61,6 +61,7 @@ type Cmd struct { Name string Args []string Env []string + Dir string Stdout chan string // streaming STDOUT if enabled, else nil (see Options) Stderr chan string // streaming STDERR if enabled, else nil (see Options) *sync.Mutex @@ -305,6 +306,7 @@ func (c *Cmd) run() { // Set the runtime environment for the command as per os/exec.Cmd. If Env // is nil, use the current process' environment. cmd.Env = c.Env + cmd.Dir = c.Dir // ////////////////////////////////////////////////////////////////////// // Start command