forked from x/icebergs
opt some
This commit is contained in:
parent
13df83be17
commit
ace01e577c
@ -154,6 +154,14 @@ func init() {
|
|||||||
nfs.FIND: {Name: "find", Help: "查找", Hand: func(m *ice.Message, arg ...string) {
|
nfs.FIND: {Name: "find", Help: "查找", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Echo(_system_find(m, arg[0], arg[1:]...))
|
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) {
|
}, Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
mdb.ListSelect(m, arg...)
|
mdb.ListSelect(m, arg...)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package chat
|
package oauth
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
@ -167,3 +167,5 @@ var Index = &ice.Context{Name: OAUTH, Help: "认证授权", Commands: map[string
|
|||||||
}}
|
}}
|
||||||
|
|
||||||
func init() { chat.Index.Register(Index, &web.Frame{}) }
|
func init() { chat.Index.Register(Index, &web.Frame{}) }
|
||||||
|
|
||||||
|
func Prefix(arg ...string) string { return kit.Keys("web.chat.oauth", arg) }
|
||||||
|
@ -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) {
|
if p := path.Join(ice.USR_INSTALL, kit.TrimExt(link)); kit.FileExists(p) {
|
||||||
return 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) {
|
func _install_download(m *ice.Message) {
|
||||||
link := m.Option(mdb.LINK)
|
link := m.Option(mdb.LINK)
|
||||||
@ -81,11 +85,7 @@ func _install_build(m *ice.Message, arg ...string) string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
func _install_order(m *ice.Message, arg ...string) {
|
func _install_order(m *ice.Message, arg ...string) {
|
||||||
p := path.Join(_install_path(m, ""), m.Option(nfs.PATH)+ice.NL)
|
m.Cmdy(cli.SYSTEM, nfs.PUSH, 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)
|
|
||||||
}
|
}
|
||||||
func _install_spawn(m *ice.Message, arg ...string) {
|
func _install_spawn(m *ice.Message, arg ...string) {
|
||||||
if kit.Int(m.Option(tcp.PORT)) >= 10000 {
|
if kit.Int(m.Option(tcp.PORT)) >= 10000 {
|
||||||
|
1
misc.go
1
misc.go
@ -313,6 +313,7 @@ func SplitCmd(name string) (list []Any) {
|
|||||||
item, button := kit.Dict(), false
|
item, button := kit.Dict(), false
|
||||||
ls := kit.Split(name, SP, ":=@")
|
ls := kit.Split(name, SP, ":=@")
|
||||||
for i := 1; i < len(ls); i++ {
|
for i := 1; i < len(ls); i++ {
|
||||||
|
Pulse.Debug("what %v %v", ls[i], kit.Formats(item))
|
||||||
switch ls[i] {
|
switch ls[i] {
|
||||||
case RUN:
|
case RUN:
|
||||||
list = append(list, kit.Dict(TYPE, BUTTON, NAME, RUN))
|
list = append(list, kit.Dict(TYPE, BUTTON, NAME, RUN))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user