1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-03-10 10:03:28 +08:00
parent 4d8bf2ccd1
commit 94b7c4b4a1
3 changed files with 5 additions and 9 deletions

View File

@ -26,7 +26,7 @@ func _runtime_init(m *ice.Message) {
m.Conf(RUNTIME, kit.Keys(HOST, OSID), release(m))
m.Conf(RUNTIME, kit.Keys(HOST, PID), os.Getpid())
m.Conf(RUNTIME, kit.Keys(HOST, PWD), kit.Path(""))
m.Conf(RUNTIME, kit.Keys(HOST, HOME), kit.Env(HOME))
m.Conf(RUNTIME, kit.Keys(HOST, HOME), kit.HomePath(""))
m.Conf(RUNTIME, kit.Keys(HOST, MAXPROCS), runtime.GOMAXPROCS(0))
for _, k := range ENV_LIST {
switch m.Conf(RUNTIME, kit.Keys(CONF, k), kit.Env(k)); k {
@ -42,10 +42,7 @@ func _runtime_init(m *ice.Message) {
if name, e := os.Hostname(); e == nil && name != "" {
m.Conf(RUNTIME, kit.Keys(BOOT, HOSTNAME), name)
}
m.Conf(RUNTIME, kit.Keys(BOOT, PATHNAME), path.Base(kit.Env("PWD")))
if name, e := os.Getwd(); e == nil && name != "" {
m.Conf(RUNTIME, kit.Keys(BOOT, PATHNAME), path.Base(name))
}
m.Conf(RUNTIME, kit.Keys(BOOT, PATHNAME), path.Base(kit.Path("")))
m.Conf(RUNTIME, kit.Keys(BOOT, USERNAME), kit.Select(kit.UserName(), kit.Env(CTX_USER)))
ice.Info.Hostname = m.Conf(RUNTIME, kit.Keys(BOOT, HOSTNAME))
ice.Info.Pathname = m.Conf(RUNTIME, kit.Keys(BOOT, PATHNAME))

View File

@ -266,7 +266,6 @@ func HashSelectField(m *ice.Message, key string, field string) (value string) {
func HashSelectTarget(m *ice.Message, key string, create Any) (target Any) {
HashSelectUpdate(m, key, func(value ice.Map) {
target = value[TARGET]
m.Debug("what %v %v", target, create)
if _target, ok := target.([]string); ok && len(_target) == 0 {
target = nil
}

View File

@ -204,11 +204,11 @@ func init() {
if opened {
return
}
switch host := kit.Format("http://localhost:%s/?debug=true", m.Option(tcp.PORT)); runtime.GOOS {
switch host := kit.Format("http://localhost:%s/", m.Option(tcp.PORT)); runtime.GOOS {
case cli.DARWIN:
m.Cmd(cli.SYSTEM, "open", host+"?debug=true")
case cli.WINDOWS:
m.Cmd(cli.SYSTEM, "explorer", host)
case cli.DARWIN:
m.Cmd(cli.SYSTEM, "open", host)
}
}()
}},