Update build.go
This commit is contained in:
parent
4b1cdbb249
commit
ed7170a02f
|
@ -17,6 +17,7 @@ package output
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
@ -94,7 +95,7 @@ func BuildHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
goBuildArgs := []string{}
|
goBuildArgs := []string{}
|
||||||
goBuildArgs = append(goBuildArgs, "build")
|
goBuildArgs = append(goBuildArgs, "build")
|
||||||
goBuildArgs = append(goBuildArgs, strings.Split(user.GoBuildArgs, " ")...)
|
goBuildArgs = append(goBuildArgs, user.GetBuildArgs(runtime.GOOS)...)
|
||||||
|
|
||||||
cmd := exec.Command("go", goBuildArgs...)
|
cmd := exec.Command("go", goBuildArgs...)
|
||||||
cmd.Dir = curDir
|
cmd.Dir = curDir
|
||||||
|
@ -130,7 +131,7 @@ func BuildHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
// display "START [go build]" in front-end browser
|
// display "START [go build]" in front-end browser
|
||||||
|
|
||||||
msg := i18n.Get(locale, "start-build").(string)
|
msg := i18n.Get(locale, "start-build").(string)
|
||||||
msg = strings.Replace(msg, "build]", "build "+user.GoBuildArgs+"]", 1)
|
msg = strings.Replace(msg, "build]", "build "+fmt.Sprint(user.GetBuildArgs(runtime.GOOS))+"]", 1)
|
||||||
|
|
||||||
channelRet["output"] = "<span class='start-build'>" + msg + "</span>\n"
|
channelRet["output"] = "<span class='start-build'>" + msg + "</span>\n"
|
||||||
channelRet["cmd"] = "start-build"
|
channelRet["cmd"] = "start-build"
|
||||||
|
|
Loading…
Reference in New Issue