diff --git a/base/cli/system.go b/base/cli/system.go index 5955810b..94d9aa3d 100644 --- a/base/cli/system.go +++ b/base/cli/system.go @@ -154,6 +154,14 @@ func init() { nfs.FIND: {Name: "find", Help: "查找", Hand: func(m *ice.Message, arg ...string) { m.Echo(_system_find(m, arg[0], arg[1:]...)) }}, + nfs.PUSH: {Name: "push", Help: "查找", Hand: func(m *ice.Message, arg ...string) { + for _, p := range arg { + if !strings.Contains(m.Cmdx(nfs.CAT, ice.ETC_PATH), p) { + m.Cmd(nfs.PUSH, ice.ETC_PATH, strings.TrimSpace(p)+ice.NL) + } + } + m.Cmdy(nfs.CAT, ice.ETC_PATH) + }}, }, Hand: func(m *ice.Message, arg ...string) { if len(arg) == 0 { mdb.ListSelect(m, arg...) diff --git a/core/chat/oauth/oauth.go b/core/chat/oauth/oauth.go index 2d15faf1..bf72fe01 100644 --- a/core/chat/oauth/oauth.go +++ b/core/chat/oauth/oauth.go @@ -1,4 +1,4 @@ -package chat +package oauth import ( "strings" @@ -167,3 +167,5 @@ var Index = &ice.Context{Name: OAUTH, Help: "认证授权", Commands: map[string }} func init() { chat.Index.Register(Index, &web.Frame{}) } + +func Prefix(arg ...string) string { return kit.Keys("web.chat.oauth", arg) } diff --git a/core/code/install.go b/core/code/install.go index 726c9db6..8e795526 100644 --- a/core/code/install.go +++ b/core/code/install.go @@ -19,7 +19,11 @@ func _install_path(m *ice.Message, link string) string { if p := path.Join(ice.USR_INSTALL, kit.TrimExt(link)); kit.FileExists(p) { return p } - return path.Join(ice.USR_INSTALL, strings.Split(m.Cmdx(cli.SYSTEM, "sh", "-c", kit.Format("tar tf %s| head -n1", path.Join(ice.USR_INSTALL, path.Base(link)))), ice.PS)[0]) + if p := path.Join(ice.USR_INSTALL, path.Base(link)); kit.FileExists(p) { + return path.Join(ice.USR_INSTALL, strings.Split(m.Cmdx(cli.SYSTEM, "sh", "-c", kit.Format("tar tf %s| head -n1", p), ice.Option{cli.CMD_OUTPUT, ""}), ice.PS)[0]) + } + m.Error(true, ice.ErrNotFound) + return "" } func _install_download(m *ice.Message) { link := m.Option(mdb.LINK) @@ -81,11 +85,7 @@ func _install_build(m *ice.Message, arg ...string) string { return "" } func _install_order(m *ice.Message, arg ...string) { - p := path.Join(_install_path(m, ""), m.Option(nfs.PATH)+ice.NL) - if !strings.Contains(m.Cmdx(nfs.CAT, ice.ETC_PATH), p) { - m.Cmd(nfs.PUSH, ice.ETC_PATH, p) - } - m.Cmdy(nfs.CAT, ice.ETC_PATH) + m.Cmdy(cli.SYSTEM, nfs.PUSH, path.Join(_install_path(m, ""), m.Option(nfs.PATH)+ice.NL)) } func _install_spawn(m *ice.Message, arg ...string) { if kit.Int(m.Option(tcp.PORT)) >= 10000 { diff --git a/misc.go b/misc.go index 4853c011..e81bb33e 100644 --- a/misc.go +++ b/misc.go @@ -313,6 +313,7 @@ func SplitCmd(name string) (list []Any) { item, button := kit.Dict(), false ls := kit.Split(name, SP, ":=@") for i := 1; i < len(ls); i++ { + Pulse.Debug("what %v %v", ls[i], kit.Formats(item)) switch ls[i] { case RUN: list = append(list, kit.Dict(TYPE, BUTTON, NAME, RUN))