1
0
forked from x/icebergs
This commit is contained in:
shaoying 2020-06-25 19:01:34 +08:00
parent 2538800449
commit afec23c3a1
2 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ var Index = &ice.Context{Name: "cli", Help: "命令模块",
// 启动信息 // 启动信息
m.Conf(RUNTIME, "boot.username", kit.Select(os.Getenv("USER"), os.Getenv("ctx_user"))) m.Conf(RUNTIME, "boot.username", kit.Select(os.Getenv("USER"), os.Getenv("ctx_user")))
if user, e := user.Current(); e == nil && user.Name != "" { if user, e := user.Current(); e == nil && user.Name != "" {
m.Conf(RUNTIME, "boot.username", user.Name) m.Conf(RUNTIME, "boot.username", kit.Select(user.Name, os.Getenv("ctx_user")))
} }
if name, e := os.Hostname(); e == nil { if name, e := os.Hostname(); e == nil {
m.Conf(RUNTIME, "boot.hostname", kit.Select(name, os.Getenv("HOSTNAME"))) m.Conf(RUNTIME, "boot.hostname", kit.Select(name, os.Getenv("HOSTNAME")))

View File

@ -139,7 +139,7 @@ var Index = &ice.Context{Name: "docker", Help: "虚拟机",
p = path.Join(p, ".bashrc") p = path.Join(p, ".bashrc")
if _, e := os.Stat(p); e != nil { if _, e := os.Stat(p); e != nil {
m.Cmd(nfs.SAVE, p, kit.Format("export ctx_dev=%s\nexport ctx_pod=%s ctx_user=%s\n", m.Cmd(nfs.SAVE, p, kit.Format("export ctx_dev=%s export ctx_pod=%s ctx_user=%s\n",
m.Conf(cli.RUNTIME, "conf.ctx_dev"), arg[0], cli.UserName)) m.Conf(cli.RUNTIME, "conf.ctx_dev"), arg[0], cli.UserName))
} }