You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// RunCompiled runs an already-compiled mage command with the given args,
705
712
funcRunCompiled(invInvocation, exePathstring, errlog*log.Logger) int {
706
713
debug.Println("running binary", exePath)
707
-
c:=exec.Command(exePath, inv.Args...)
714
+
c:=dryrun.Wrap(exePath, inv.Args...)
708
715
c.Stderr=inv.Stderr
709
716
c.Stdout=inv.Stdout
710
717
c.Stdin=inv.Stdin
711
718
c.Dir=inv.Dir
712
719
ifinv.WorkDir!=inv.Dir {
713
720
c.Dir=inv.WorkDir
714
721
}
722
+
715
723
// intentionally pass through unaltered os.Environ here.. your magefile has
716
724
// to deal with it.
717
725
c.Env=os.Environ()
726
+
727
+
// We don't want to actually allow dryrun in the outermost invocation of mage, since that will inhibit the very compilation of the magefile & the use of the resulting binary.
728
+
// But every situation that's within such an execution is one in which dryrun is supported, so we set this environment variable which will be carried over throughout all such situations.
// In dryrun mode, the actual "command" will just print the cmd and args to stdout; so we want to make sure we're outputting that regardless of verbosity settings.
0 commit comments