Skip to content

Commit

Permalink
Cleanup args for running compiled mage
Browse files Browse the repository at this point in the history
  • Loading branch information
perrito666 committed Nov 19, 2023
1 parent 810ac62 commit 7934dd6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mage/main.go
Expand Up @@ -724,11 +724,10 @@ func generateInit(dir string) error {
// RunCompiled runs an already-compiled mage command with the given args,
func RunCompiled(inv Invocation, exePath string, errlog *log.Logger) int {
debug.Println("running binary", exePath)
args := make([]string, 0, len(inv.Args)+len(inv.ExtraArgs)+1)
args := make([]string, len(inv.Args), len(inv.Args)+len(inv.ExtraArgs)+1)
copy(args, inv.Args)
if len(inv.ExtraArgs) > 0 {

args = append(append(inv.Args, "--"), inv.ExtraArgs...)
args = append(append(args, "--"), inv.ExtraArgs...)
}

c := exec.Command(exePath, args...)
Expand Down

0 comments on commit 7934dd6

Please sign in to comment.