forked from x/icebergs
opt some
This commit is contained in:
parent
16b8cb1ded
commit
a3a764d0d6
@ -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...))
|
||||
}},
|
||||
}})
|
||||
|
@ -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] == "" {
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user