1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00
This commit is contained in:
shaoying 2021-01-30 23:13:11 +08:00
parent c00ea56fd4
commit 8739c8fa6f
11 changed files with 37 additions and 23 deletions

View File

@ -314,7 +314,7 @@ func (f *Frame) Start(m *ice.Message, arg ...string) bool {
}
if f.count = 1; f.source == STDIO {
m.Option("_disable_log", "true")
// m.Option("_disable_log", "true")
f.count = kit.Int(m.Conf(SOURCE, "hash.stdio.meta.count")) + 1
f.scan(m, STDIO, "", r)
} else {

View File

@ -83,6 +83,7 @@ func init() {
_autogen_main(m, m.Option("main"), _autogen_mod(m, "go.mod"), m.Option("name"))
}
m.Cmdy(cli.SYSTEM, "make")
m.Option(ice.MSG_PROCESS, ice.PROCESS_INNER)
}},
mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
switch arg[0] {

View File

@ -34,14 +34,14 @@ shy.go
go.go
js.go
install.go
autogen.go
compile.go
binpack.go
webpack.go
publish.go
upgrade.go
autogen.go
webpack.go
binpack.go
install.go
code.go
code.shy

View File

@ -56,7 +56,7 @@ func init() {
// 编译参数
m.Optionv(cli.CMD_ENV, kit.Simple(m.Confv(COMPILE, "meta.env"), "GOARCH", arch, "GOOS", goos))
if msg := m.Cmd(cli.SYSTEM, m.Confv(COMPILE, "meta.go"), "-o", file, main); msg.Append(cli.CMD_CODE) != "0" {
if msg := m.Cmd(cli.SYSTEM, m.Confv(COMPILE, "meta.go"), "-o", file, main, "src/version.go"); msg.Append(cli.CMD_CODE) != "0" {
m.Copy(msg)
return
}

View File

@ -9,7 +9,7 @@ import (
func _csdn_show(m *ice.Message, name, text string, arg ...string) {
}
func _csdn_search(m *ice.Message, kind, name, text string) {
if kit.Contains(kind, "*") || kit.Contains(kind, "csdn") {
if kit.Contains(kind, kit.MDB_FOREACH) || kit.Contains(kind, CSDN) {
m.PushSearchWeb(CSDN, name)
}
}
@ -22,12 +22,12 @@ func init() {
CSDN: {Name: "csdn", Help: "博客", Value: kit.Data(kit.MDB_SHORT, kit.MDB_TEXT)},
}, Commands: map[string]*ice.Command{
CSDN: {Name: "csdn [name] word", Help: "博客", Action: map[string]*ice.Action{
mdb.SEARCH: {Name: "search type name text", Help: "搜索", Hand: func(m *ice.Message, arg ...string) {
_csdn_search(m, arg[0], arg[1], arg[2])
}},
mdb.CREATE: {Name: "create type name text", Help: "创建", Hand: func(m *ice.Message, arg ...string) {
m.Cmd(mdb.INSERT, m.Prefix(CSDN), "", mdb.HASH, arg)
}},
mdb.SEARCH: {Name: "search type name text", Help: "搜索", Hand: func(m *ice.Message, arg ...string) {
_csdn_search(m, arg[0], arg[1], arg[2])
}},
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
_csdn_show(m, arg[0], kit.Select(arg[0], arg[1]), arg[2:]...)
}},

View File

@ -23,12 +23,12 @@ func init() {
},
Commands: map[string]*ice.Command{
GITHUB: {Name: "github [name] word", Help: "百度", Action: map[string]*ice.Action{
mdb.SEARCH: {Name: "search type name text", Help: "搜索", Hand: func(m *ice.Message, arg ...string) {
_github_search(m, arg[0], arg[1], arg[2])
}},
mdb.CREATE: {Name: "create type name text", Help: "创建", Hand: func(m *ice.Message, arg ...string) {
m.Cmd(mdb.INSERT, m.Prefix(GITHUB), "", mdb.HASH, arg)
}},
mdb.SEARCH: {Name: "search type name text", Help: "搜索", Hand: func(m *ice.Message, arg ...string) {
_github_search(m, arg[0], arg[1], arg[2])
}},
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
_github_show(m, arg[0], kit.Select(arg[0], arg[1]), arg[2:]...)
}},

View File

@ -28,7 +28,7 @@ func init() {
)},
},
Commands: map[string]*ice.Command{
INSTALL: {Name: "install name port path auto", Help: "安装", Meta: kit.Dict(), Action: map[string]*ice.Action{
INSTALL: {Name: "install name port path auto download", Help: "安装", Meta: kit.Dict(), Action: map[string]*ice.Action{
web.DOWNLOAD: {Name: "download link", Help: "下载", Hand: func(m *ice.Message, arg ...string) {
link := m.Option(kit.MDB_LINK)
name := path.Base(link)

View File

@ -23,12 +23,11 @@ func init() {
},
Commands: map[string]*ice.Command{
UPGRADE: {Name: "upgrade item:select=system 执行:button", Help: "升级", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
exit := false
m.Grows(cmd, kit.Keys(kit.MDB_HASH, kit.Select("system", arg, 0)), "", "", func(index int, value map[string]interface{}) {
m.Option("exit", "true")
if value[kit.MDB_FILE] == "ice.bin" {
// 程序文件
value[kit.MDB_FILE] = kit.Keys("ice", m.Conf(cli.RUNTIME, "host.GOOS"), m.Conf(cli.RUNTIME, "host.GOARCH"))
exit = true
}
// 下载文件
@ -36,7 +35,7 @@ func init() {
m.Cmd(web.STORY, web.WATCH, msg.Append(kit.MDB_FILE), value[kit.MDB_PATH])
os.Chmod(kit.Format(value[kit.MDB_PATH]), 0770)
})
if exit {
if m.Option("exit") == "true" {
m.Sleep("1s").Go(func() { m.Cmd("exit", 1) })
}
}},

View File

@ -24,7 +24,6 @@ func init() {
}},
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
_wiki_list(m, FEEL, kit.Select("./", arg, 0))
m.Option(ice.MSG_DISPLAY, "")
m.SortTimeR(kit.MDB_TIME)
}},
},

View File

@ -18,17 +18,16 @@ func _wiki_path(m *ice.Message, cmd string, arg ...string) string {
func _wiki_list(m *ice.Message, cmd string, arg ...string) bool {
m.Option("prefix", m.Option(nfs.DIR_ROOT, _wiki_path(m, cmd)))
if len(arg) == 0 || strings.HasSuffix(arg[0], "/") {
m.Option(ice.MSG_DISPLAY, "table")
if m.Option(nfs.DIR_DEEP) != "true" {
// 目录列表
m.Option(nfs.DIR_TYPE, nfs.DIR)
m.Cmdy(nfs.DIR, kit.Select("./", arg, 0), "time size path")
m.Cmdy(nfs.DIR, kit.Select("./", arg, 0), "time,size,path")
}
// 文件列表
m.Option(nfs.DIR_TYPE, nfs.FILE)
m.Option(nfs.DIR_REG, m.Conf(cmd, "meta.regs"))
m.Cmdy(nfs.DIR, kit.Select("./", arg, 0), "time size path")
m.Cmdy(nfs.DIR, kit.Select("./", arg, 0), "time,size,path")
return true
}
return false
@ -65,7 +64,7 @@ var Index = &ice.Context{Name: WIKI, Help: "文档中心",
func init() {
web.Index.Register(Index, &web.Frame{},
FEEL, WORD, DATA, DRAW,
FEEL, DRAW, DATA, WORD,
SPARK, IMAGE,
)
}

View File

@ -1 +1,17 @@
chapter "文档"
wiki.go
wiki.shy
baidu.go
music.go
video.go
chart.go
template.go
feel.go
draw.go
data.go
word.go