mirror of
https://shylinux.com/x/icebergs
synced 2025-04-28 10:12:02 +08:00
opt some
This commit is contained in:
parent
4d8bf2ccd1
commit
94b7c4b4a1
@ -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, OSID), release(m))
|
||||||
m.Conf(RUNTIME, kit.Keys(HOST, PID), os.Getpid())
|
m.Conf(RUNTIME, kit.Keys(HOST, PID), os.Getpid())
|
||||||
m.Conf(RUNTIME, kit.Keys(HOST, PWD), kit.Path(""))
|
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))
|
m.Conf(RUNTIME, kit.Keys(HOST, MAXPROCS), runtime.GOMAXPROCS(0))
|
||||||
for _, k := range ENV_LIST {
|
for _, k := range ENV_LIST {
|
||||||
switch m.Conf(RUNTIME, kit.Keys(CONF, k), kit.Env(k)); k {
|
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 != "" {
|
if name, e := os.Hostname(); e == nil && name != "" {
|
||||||
m.Conf(RUNTIME, kit.Keys(BOOT, HOSTNAME), name)
|
m.Conf(RUNTIME, kit.Keys(BOOT, HOSTNAME), name)
|
||||||
}
|
}
|
||||||
m.Conf(RUNTIME, kit.Keys(BOOT, PATHNAME), path.Base(kit.Env("PWD")))
|
m.Conf(RUNTIME, kit.Keys(BOOT, PATHNAME), path.Base(kit.Path("")))
|
||||||
if name, e := os.Getwd(); e == nil && name != "" {
|
|
||||||
m.Conf(RUNTIME, kit.Keys(BOOT, PATHNAME), path.Base(name))
|
|
||||||
}
|
|
||||||
m.Conf(RUNTIME, kit.Keys(BOOT, USERNAME), kit.Select(kit.UserName(), kit.Env(CTX_USER)))
|
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.Hostname = m.Conf(RUNTIME, kit.Keys(BOOT, HOSTNAME))
|
||||||
ice.Info.Pathname = m.Conf(RUNTIME, kit.Keys(BOOT, PATHNAME))
|
ice.Info.Pathname = m.Conf(RUNTIME, kit.Keys(BOOT, PATHNAME))
|
||||||
|
@ -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) {
|
func HashSelectTarget(m *ice.Message, key string, create Any) (target Any) {
|
||||||
HashSelectUpdate(m, key, func(value ice.Map) {
|
HashSelectUpdate(m, key, func(value ice.Map) {
|
||||||
target = value[TARGET]
|
target = value[TARGET]
|
||||||
m.Debug("what %v %v", target, create)
|
|
||||||
if _target, ok := target.([]string); ok && len(_target) == 0 {
|
if _target, ok := target.([]string); ok && len(_target) == 0 {
|
||||||
target = nil
|
target = nil
|
||||||
}
|
}
|
||||||
|
@ -204,11 +204,11 @@ func init() {
|
|||||||
if opened {
|
if opened {
|
||||||
return
|
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:
|
case cli.WINDOWS:
|
||||||
m.Cmd(cli.SYSTEM, "explorer", host)
|
m.Cmd(cli.SYSTEM, "explorer", host)
|
||||||
case cli.DARWIN:
|
|
||||||
m.Cmd(cli.SYSTEM, "open", host)
|
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}},
|
}},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user