1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-25 17:18:05 +08:00
This commit is contained in:
harveyshao 2022-06-19 20:02:26 +08:00
parent 13df83be17
commit ace01e577c
4 changed files with 18 additions and 7 deletions

View File

@ -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...)

View File

@ -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) }

View File

@ -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 {

View File

@ -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))