1
0
mirror of https://github.com/beego/bee.git synced 2025-07-04 11:40:17 +00:00

add parms for go executable file path!

This commit is contained in:
qiantao
2019-03-05 19:24:29 +08:00
parent 10bb0454f6
commit f1826c0bc3
5 changed files with 22 additions and 14 deletions

View File

@ -53,8 +53,11 @@ var (
format string
)
var cmdName = "go"
func init() {
fs := flag.NewFlagSet("pack", flag.ContinueOnError)
fs.StringVar(&cmdName, "gobin", "go", "go executable file path or alias")
fs.StringVar(&appPath, "p", "", "Set the application path. Defaults to the current path.")
fs.BoolVar(&build, "b", true, "Tell the command to do a build for the current platform. Defaults to true.")
fs.StringVar(&buildArgs, "ba", "", "Specify additional args for Go build.")
@ -508,7 +511,7 @@ func packApp(cmd *commands.Command, args []string) int {
fmt.Fprintf(output, "\t%s%s+ go %s%s%s\n", "\x1b[32m", "\x1b[1m", strings.Join(args, " "), "\x1b[21m", "\x1b[0m")
}
execmd := exec.Command("go", args...)
execmd := exec.Command(string(cmdName), args...)
execmd.Env = append(os.Environ(), envs...)
execmd.Stdout = os.Stdout
execmd.Stderr = os.Stderr