1
0
mirror of https://shylinux.com/x/icebergs synced 2025-05-03 20:07:01 +08:00

opt word.js

This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-03-05 10:47:43 +08:00
parent 9b8b7831fe
commit 7c14a9735a
3 changed files with 13 additions and 4 deletions

View File

@ -223,6 +223,11 @@ const (
func init() {
Index.MergeCommands(ice.Commands{
SHELL: {Name: "shell", Help: "交互命令", Actions: mdb.HashAction(), Hand: func(m *ice.Message, arg ...string) {
if f, ok := m.Target().Server().(*Frame); ok {
f.Spawn(m, m.Target()).Start(m, arg...)
}
}},
SOURCE: {Name: "source file run", Help: "脚本解析", Actions: mdb.HashAction(), Hand: func(m *ice.Message, arg ...string) {
if f, ok := m.Target().Server().(*Frame); ok {
f.Spawn(m, m.Target()).Start(m, arg...)

View File

@ -124,7 +124,9 @@ func init() {
GO: {Name: "go path auto", Help: "后端编程", Actions: ice.MergeActions(ice.Actions{
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { m.Cmd(NAVIGATE, mdb.CREATE, GODOC, m.PrefixKey()) }},
mdb.RENDER: {Hand: func(m *ice.Message, arg ...string) {
cmds, text := "ice.bin space dial dev ops", ctx.GetFileCmd(path.Join(arg[2], arg[1]))
cmds, text := "ice.bin source stdio", ctx.GetFileCmd(path.Join(arg[2], arg[1]))
ls := strings.Split(text, ice.PT)
text = "~" + kit.Join(kit.Slice(ls, 0, -1), ice.PT) + ice.NL + kit.Slice(ls, -1)[0]
_xterm_show(m, cmds, text)
}},
mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) {

View File

@ -7,7 +7,6 @@ import (
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/ctx"
"shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/ssh"
"shylinux.com/x/icebergs/base/web"
kit "shylinux.com/x/toolkits"
)
@ -20,8 +19,11 @@ func init() {
mdb.RENDER: {Hand: func(m *ice.Message, arg ...string) {
ctx.ProcessCommand(m, web.WIKI_WORD, kit.Simple(path.Join(arg[2], arg[1])))
}},
mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(ssh.SOURCE, path.Join(arg[2], arg[1])) }},
TEMPLATE: {Hand: func(m *ice.Message, arg ...string) { m.Echo(`chapter "hi"`) }},
mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) {
ctx.ProcessCommand(m, web.WIKI_WORD, kit.Simple(path.Join(arg[2], arg[1])))
// m.Cmdy(ssh.SOURCE, path.Join(arg[2], arg[1]))
}},
TEMPLATE: {Hand: func(m *ice.Message, arg ...string) { m.Echo(`chapter "hi"`) }},
}, PlugAction()), Hand: func(m *ice.Message, arg ...string) {
if len(arg) > 0 && kit.Ext(arg[0]) == m.CommandKey() {
m.Cmdy(web.WIKI_WORD, path.Join(ice.SRC, strings.TrimPrefix(arg[0], "src/")))