diff --git a/sh/cmd.go b/sh/cmd.go index 87bb37e6..35d232a4 100644 --- a/sh/cmd.go +++ b/sh/cmd.go @@ -137,7 +137,10 @@ func run(env map[string]string, stdout, stderr io.Writer, cmd string, args ...st for i := range args { quoted = append(quoted, fmt.Sprintf("%q", args[i])); } - log.Println("exec:", cmd, strings.Join(quoted, " ")) + // To protect against logging from doing exec in global variables + if mg.Verbose() { + log.Println("exec:", cmd, strings.Join(quoted, " ")) + } err = c.Run() return CmdRan(err), ExitStatus(err), err }