Skip to content

Commit

Permalink
fix output path
Browse files Browse the repository at this point in the history
  • Loading branch information
CAFxX committed May 10, 2023
1 parent ba85b43 commit ab7b565
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func main() {
os.Exit(2)
}

o := cwd
o := filepath.Base(cwd)
var args []string
for i := 1; i < len(os.Args); i++ {
if os.Args[i] == "-o" && len(os.Args) > i+1 {
Expand All @@ -73,6 +73,9 @@ func main() {
args = append(args, os.Args[i])
}
}
if !filepath.IsAbs(o) {
o = filepath.Join(cwd, o)
}

tmpdir, err := os.MkdirTemp("", "mgo")
if err != nil {
Expand Down Expand Up @@ -132,7 +135,7 @@ func main() {
}

cmd = exec.Command("go")
cmd.Args = []string{"go", "build", "-C", tmpdir, "-o", filepath.Join(cwd, o), "-trimpath", "./launcher"}
cmd.Args = []string{"go", "build", "-C", tmpdir, "-o", o, "-trimpath", "./launcher"}
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
Expand Down

0 comments on commit ab7b565

Please sign in to comment.