Skip to content

Commit

Permalink
fix : flag provided but not defined: -w
Browse files Browse the repository at this point in the history
  • Loading branch information
muyuballs authored Jan 17, 2020
1 parent fb28677 commit a46b859
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/cmd/deploy/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func build(mode, target, path, ldFlagsCustom, tagsCustom, name, depPath string,
cmd := exec.Command("go", "build", "-p", strconv.Itoa(runtime.GOMAXPROCS(0)), "-v")
if len(ldFlags) > 0 {
if !(utils.GOVERSION_NUM() >= 113 && utils.UseGOMOD(path)) {
cmd.Args = append(cmd.Args, fmt.Sprintf("-ldflags=%v%v", pattern, escapeFlags(ldFlags, ldFlagsCustom)))
cmd.Args = append(cmd.Args, fmt.Sprintf("-ldflags=%v'%v'", pattern, escapeFlags(ldFlags, ldFlagsCustom)))
}
}
if utils.GOVERSION_NUM() >= 113 {
Expand Down Expand Up @@ -113,7 +113,7 @@ func build(mode, target, path, ldFlagsCustom, tagsCustom, name, depPath string,
}
return b.String()
}
cmd.Args = append(cmd.Args, fmt.Sprintf("-ldflags=%v%v", pattern, escapeFlags(ldFlags, ldFlagsCustom)))
cmd.Args = append(cmd.Args, fmt.Sprintf("-ldflags=%v'%v'", pattern, escapeFlags(ldFlags, ldFlagsCustom)))
if runtime.GOOS != "windows" {
cmd.Args = []string{"bash", "-c", String(cmd)}
} else {
Expand Down

0 comments on commit a46b859

Please sign in to comment.