mirror of
https://github.com/beego/bee.git
synced 2024-12-22 15:10:49 +00:00
reduce build command if user enabled install
This commit is contained in:
parent
18f0a708ed
commit
3674476b3d
20
watch.go
20
watch.go
@ -18,6 +18,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
@ -127,10 +128,21 @@ func Autobuild() {
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
bcmd := exec.Command(cmdName, "build")
|
||||
bcmd.Stdout = os.Stdout
|
||||
bcmd.Stderr = os.Stderr
|
||||
err = bcmd.Run()
|
||||
appName := appname
|
||||
if runtime.GOOS == "windows" {
|
||||
appName += ".exe"
|
||||
}
|
||||
binPath := GetGOPATHs()[0] + "/bin/" + appName
|
||||
|
||||
if conf.GoInstall && isExist(binPath) {
|
||||
os.Rename(binPath, appName)
|
||||
ColorLog("[INFO] Build command reduced\n")
|
||||
} else {
|
||||
bcmd := exec.Command(cmdName, "build")
|
||||
bcmd.Stdout = os.Stdout
|
||||
bcmd.Stderr = os.Stderr
|
||||
err = bcmd.Run()
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user