提交 e6725b2a 编写于 作者: yanghye's avatar yanghye

energy-command-line, 优化命令 install .

上级 f3fa81c8
......@@ -55,10 +55,10 @@ func SetGoEnv(goRoot string) {
//export GOBIN=$GOROOT/bin
//export PATH=$PATH:$GOBIN
var exGoRoot = fmt.Sprintf("export GOROOT=%s", goRoot)
//var exGoCache = "export GOCACHE==$GOROOT/gocache"
var exGoCache = "export GOCACHE=$GOROOT/go-build"
var exGoBin = "export GOBIN=$GOROOT/bin"
var exPath = "export PATH=$PATH:$GOBIN"
var exs = []string{exGoRoot /*exGoCache,*/, exGoBin}
var exs = []string{exGoRoot, exGoCache, exGoBin}
setPosixEnv(exs, exPath, "$GOBIN")
println("\nHint: Reopen the cmd window for the Go command to take effect.")
}
......
......@@ -93,6 +93,9 @@ func appendWindowsEnv(name, value string) {
values := strings.Split(val, "\\")
for i, vab := range values {
vab = strings.TrimSpace(vab)
if vab == "" || len(vab) <= 2 {
continue
}
if vab[0] == '%' && vab[len(vab)-1] == '%' {
vab = vab[1 : len(vab)-1]
if v, err := regCurUser.Read(vab); err == nil {
......
......@@ -21,9 +21,9 @@ import (
var CmdInit = &command.Command{
UsageLine: "init -n [name]",
Short: "init energy project",
Short: "Initialized energy project",
Long: `
-n initialized project name
-n Initialized project name
Initialize energy golang project
. Execute default command
`,
......@@ -44,7 +44,7 @@ func runInit(c *command.Config) error {
}
if strings.TrimSpace(m.ResLoad) == "" {
println("Resource loading method, default 1 HTTP")
print("1: HTTP, 2: Local Load, Number: ")
print("1: HTTP\n2: Local Load\n Number: ")
fmt.Scan(&m.ResLoad)
println()
}
......
......@@ -53,7 +53,7 @@ func generaProject(c *command.Config) error {
projectPath := filepath.Join(c.Wd, c.Init.Name)
println("Create Project:", c.Init.Name)
if tools.IsExist(projectPath) {
fmt.Printf("project dir %s exist, Do you want to delete and recreate? Y/n: ", c.Init.Name)
fmt.Printf("project dir %s exist, Delete and recreate? (Y/n): ", c.Init.Name)
var s string
fmt.Scan(&s)
println()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册