1
0
mirror of https://github.com/beego/bee.git synced 2025-06-11 03:10:40 +00:00
This commit is contained in:
astaxie
2017-03-17 13:33:15 +08:00
parent 20c6a26952
commit dd3f690bf7
96 changed files with 865 additions and 8639 deletions

View File

@ -131,14 +131,10 @@ func AutoBuild(files []string, isgenerate bool) {
os.Chdir(currpath)
cmdName := "go"
if config.Conf.Gopm.Enable {
cmdName = "gopm"
}
var (
err error
stderr bytes.Buffer
stdout bytes.Buffer
)
// For applications use full import path like "github.com/.../.."
// are able to use "go install" to reduce build time.
@ -149,28 +145,6 @@ func AutoBuild(files []string, isgenerate bool) {
icmd.Env = append(os.Environ(), "GOGC=off")
icmd.Run()
}
if config.Conf.Gopm.Install {
icmd := exec.Command("go", "list", "./...")
icmd.Stdout = &stdout
icmd.Env = append(os.Environ(), "GOGC=off")
err = icmd.Run()
if err == nil {
list := strings.Split(stdout.String(), "\n")[1:]
for _, pkg := range list {
if len(pkg) == 0 {
continue
}
icmd = exec.Command(cmdName, "install", pkg)
icmd.Stdout = os.Stdout
icmd.Stderr = os.Stderr
icmd.Env = append(os.Environ(), "GOGC=off")
err = icmd.Run()
if err != nil {
break
}
}
}
}
if isgenerate {
beeLogger.Log.Info("Generating the docs...")