diff --git a/base/cli/system.go b/base/cli/system.go index 0056a43d..330d239d 100644 --- a/base/cli/system.go +++ b/base/cli/system.go @@ -155,6 +155,10 @@ func init() { if len(arg) == 1 { arg = kit.Split(arg[0]) } + if strings.HasSuffix(arg[0], ".sh") { + arg = []string{"sh", path.Join("src", arg[0])} + } + m.Debug("arg %v", arg) _system_exec(m, _system_cmd(m, arg...)) }}, }}) diff --git a/core/chat/website.go b/core/chat/website.go index ca1dc5a0..a8ce04d5 100644 --- a/core/chat/website.go +++ b/core/chat/website.go @@ -55,10 +55,22 @@ func _website_parse(m *ice.Message, text string, args ...string) (map[string]int ls[0] = kit.Select("can.code.inner.plugin", key) data[ctx.DISPLAY] = display case nfs.GO: - ls[0] = ice.GetFileKey(display) + key := ice.GetFileKey(display) + if key == "" { + for k, v := range ice.Info.File { + if strings.HasSuffix(k, ls[0]) { + key = v + } + } + } + ls[0] = key case nfs.SH: - ls[0] = ice.GetFileKey(display) - data[ctx.DISPLAY] = display + key := ice.GetFileKey(display) + if key == "" { + key = "cli.system" + } + data[ctx.ARGS] = kit.List(ls[0]) + ls[0] = key } if ls[0] == "" { diff --git a/core/code/binpack.go b/core/code/binpack.go index aac50020..3aa74ce1 100644 --- a/core/code/binpack.go +++ b/core/code/binpack.go @@ -76,7 +76,7 @@ func init() { m.Cmd(BINPACK, mdb.REMOVE) } if kit.FileExists("src/website/index.txt") { - if s := m.Cmdx("web.chat.website", "show", "index.txt", "Header.style.display", "block"); s != "" { + if s := m.Cmdx("web.chat.website", "show", "index.txt", "Header", "", "River", "", "Action", "", "Footer", ""); s != "" { ice.Info.Pack["/page/index.html"] = []byte(s) } } diff --git a/core/code/sh.go b/core/code/sh.go index 3c5edb5b..ac356c56 100644 --- a/core/code/sh.go +++ b/core/code/sh.go @@ -31,7 +31,6 @@ func init() { }}, mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(cli.SYSTEM, SH, "-c", kit.Join(_sh_main_script(m, arg...), ice.NL)).SetAppend() - }}, mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) { if arg[0] == mdb.FOREACH { diff --git a/core/code/vimer.go b/core/code/vimer.go index db176d4f..f87962f0 100644 --- a/core/code/vimer.go +++ b/core/code/vimer.go @@ -2,6 +2,7 @@ package code import ( "path" + "strings" ice "shylinux.com/x/icebergs" "shylinux.com/x/icebergs/base/cli" @@ -22,6 +23,12 @@ func init() { m.Cmdy(AUTOGEN, mdb.CREATE, arg) }}, "script": {Name: "script file=hi/hi.js text=", Help: "脚本", Hand: func(m *ice.Message, arg ...string) { + m.Option(mdb.TEXT, strings.TrimSpace(m.Option(mdb.TEXT))) + m.Cmdy(TEMPLATE, nfs.DEFS) + }}, + "website": {Name: "script file=hi.txt text=", Help: "网页", Hand: func(m *ice.Message, arg ...string) { + m.Option(nfs.FILE, path.Join("website", m.Option(nfs.FILE))) + m.Option(mdb.TEXT, strings.TrimSpace(m.Option(mdb.TEXT))) m.Cmdy(TEMPLATE, nfs.DEFS) }}, COMPILE: {Name: "compile", Help: "编译", Hand: func(m *ice.Message, arg ...string) {