1
0
forked from x/icebergs

opt order.js

This commit is contained in:
shaoying 2020-06-25 18:54:04 +08:00
parent 68226e0df8
commit 2538800449
2 changed files with 4 additions and 3 deletions

View File

@ -42,6 +42,7 @@ var Index = &ice.Context{Name: "cli", Help: "命令模块",
m.Conf(RUNTIME, "conf.ctx_dev", os.Getenv("ctx_dev"))
m.Conf(RUNTIME, "conf.ctx_shy", os.Getenv("ctx_shy"))
m.Conf(RUNTIME, "conf.ctx_pid", os.Getenv("ctx_pid"))
m.Conf(RUNTIME, "conf.ctx_user", os.Getenv("ctx_user"))
// 主机信息
m.Conf(RUNTIME, "host.GOARCH", runtime.GOARCH)
@ -49,7 +50,7 @@ var Index = &ice.Context{Name: "cli", Help: "命令模块",
m.Conf(RUNTIME, "host.pid", os.Getpid())
// 启动信息
m.Conf(RUNTIME, "boot.username", os.Getenv("USER"))
m.Conf(RUNTIME, "boot.username", kit.Select(os.Getenv("USER"), os.Getenv("ctx_user")))
if user, e := user.Current(); e == nil && user.Name != "" {
m.Conf(RUNTIME, "boot.username", user.Name)
}

View File

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