mirror of
https://shylinux.com/x/icebergs
synced 2025-04-28 10:12:02 +08:00
opt code
This commit is contained in:
parent
c00ea56fd4
commit
8739c8fa6f
@ -314,7 +314,7 @@ func (f *Frame) Start(m *ice.Message, arg ...string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if f.count = 1; f.source == STDIO {
|
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.count = kit.Int(m.Conf(SOURCE, "hash.stdio.meta.count")) + 1
|
||||||
f.scan(m, STDIO, "", r)
|
f.scan(m, STDIO, "", r)
|
||||||
} else {
|
} else {
|
||||||
|
@ -83,6 +83,7 @@ func init() {
|
|||||||
_autogen_main(m, m.Option("main"), _autogen_mod(m, "go.mod"), m.Option("name"))
|
_autogen_main(m, m.Option("main"), _autogen_mod(m, "go.mod"), m.Option("name"))
|
||||||
}
|
}
|
||||||
m.Cmdy(cli.SYSTEM, "make")
|
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) {
|
mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
|
||||||
switch arg[0] {
|
switch arg[0] {
|
||||||
|
@ -34,14 +34,14 @@ shy.go
|
|||||||
go.go
|
go.go
|
||||||
js.go
|
js.go
|
||||||
|
|
||||||
install.go
|
autogen.go
|
||||||
compile.go
|
compile.go
|
||||||
binpack.go
|
|
||||||
webpack.go
|
|
||||||
|
|
||||||
publish.go
|
publish.go
|
||||||
upgrade.go
|
upgrade.go
|
||||||
autogen.go
|
|
||||||
|
webpack.go
|
||||||
|
binpack.go
|
||||||
|
install.go
|
||||||
|
|
||||||
code.go
|
code.go
|
||||||
code.shy
|
code.shy
|
||||||
|
@ -56,7 +56,7 @@ func init() {
|
|||||||
|
|
||||||
// 编译参数
|
// 编译参数
|
||||||
m.Optionv(cli.CMD_ENV, kit.Simple(m.Confv(COMPILE, "meta.env"), "GOARCH", arch, "GOOS", goos))
|
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)
|
m.Copy(msg)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
func _csdn_show(m *ice.Message, name, text string, arg ...string) {
|
func _csdn_show(m *ice.Message, name, text string, arg ...string) {
|
||||||
}
|
}
|
||||||
func _csdn_search(m *ice.Message, kind, name, text 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)
|
m.PushSearchWeb(CSDN, name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -22,12 +22,12 @@ func init() {
|
|||||||
CSDN: {Name: "csdn", Help: "博客", Value: kit.Data(kit.MDB_SHORT, kit.MDB_TEXT)},
|
CSDN: {Name: "csdn", Help: "博客", Value: kit.Data(kit.MDB_SHORT, kit.MDB_TEXT)},
|
||||||
}, Commands: map[string]*ice.Command{
|
}, Commands: map[string]*ice.Command{
|
||||||
CSDN: {Name: "csdn [name] word", Help: "博客", Action: map[string]*ice.Action{
|
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) {
|
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)
|
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) {
|
}, 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:]...)
|
_csdn_show(m, arg[0], kit.Select(arg[0], arg[1]), arg[2:]...)
|
||||||
}},
|
}},
|
||||||
|
@ -23,12 +23,12 @@ func init() {
|
|||||||
},
|
},
|
||||||
Commands: map[string]*ice.Command{
|
Commands: map[string]*ice.Command{
|
||||||
GITHUB: {Name: "github [name] word", Help: "百度", Action: map[string]*ice.Action{
|
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) {
|
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)
|
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) {
|
}, 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:]...)
|
_github_show(m, arg[0], kit.Select(arg[0], arg[1]), arg[2:]...)
|
||||||
}},
|
}},
|
||||||
|
@ -28,7 +28,7 @@ func init() {
|
|||||||
)},
|
)},
|
||||||
},
|
},
|
||||||
Commands: map[string]*ice.Command{
|
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) {
|
web.DOWNLOAD: {Name: "download link", Help: "下载", Hand: func(m *ice.Message, arg ...string) {
|
||||||
link := m.Option(kit.MDB_LINK)
|
link := m.Option(kit.MDB_LINK)
|
||||||
name := path.Base(link)
|
name := path.Base(link)
|
||||||
|
@ -23,12 +23,11 @@ func init() {
|
|||||||
},
|
},
|
||||||
Commands: map[string]*ice.Command{
|
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) {
|
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.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" {
|
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"))
|
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])
|
m.Cmd(web.STORY, web.WATCH, msg.Append(kit.MDB_FILE), value[kit.MDB_PATH])
|
||||||
os.Chmod(kit.Format(value[kit.MDB_PATH]), 0770)
|
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) })
|
m.Sleep("1s").Go(func() { m.Cmd("exit", 1) })
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
|
@ -24,7 +24,6 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
_wiki_list(m, FEEL, kit.Select("./", arg, 0))
|
_wiki_list(m, FEEL, kit.Select("./", arg, 0))
|
||||||
m.Option(ice.MSG_DISPLAY, "")
|
|
||||||
m.SortTimeR(kit.MDB_TIME)
|
m.SortTimeR(kit.MDB_TIME)
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
|
@ -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 {
|
func _wiki_list(m *ice.Message, cmd string, arg ...string) bool {
|
||||||
m.Option("prefix", m.Option(nfs.DIR_ROOT, _wiki_path(m, cmd)))
|
m.Option("prefix", m.Option(nfs.DIR_ROOT, _wiki_path(m, cmd)))
|
||||||
if len(arg) == 0 || strings.HasSuffix(arg[0], "/") {
|
if len(arg) == 0 || strings.HasSuffix(arg[0], "/") {
|
||||||
m.Option(ice.MSG_DISPLAY, "table")
|
|
||||||
if m.Option(nfs.DIR_DEEP) != "true" {
|
if m.Option(nfs.DIR_DEEP) != "true" {
|
||||||
// 目录列表
|
// 目录列表
|
||||||
m.Option(nfs.DIR_TYPE, nfs.DIR)
|
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_TYPE, nfs.FILE)
|
||||||
m.Option(nfs.DIR_REG, m.Conf(cmd, "meta.regs"))
|
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 true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
@ -65,7 +64,7 @@ var Index = &ice.Context{Name: WIKI, Help: "文档中心",
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
web.Index.Register(Index, &web.Frame{},
|
web.Index.Register(Index, &web.Frame{},
|
||||||
FEEL, WORD, DATA, DRAW,
|
FEEL, DRAW, DATA, WORD,
|
||||||
SPARK, IMAGE,
|
SPARK, IMAGE,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1 +1,17 @@
|
|||||||
chapter "文档"
|
chapter "文档"
|
||||||
|
|
||||||
|
wiki.go
|
||||||
|
wiki.shy
|
||||||
|
|
||||||
|
baidu.go
|
||||||
|
music.go
|
||||||
|
video.go
|
||||||
|
|
||||||
|
chart.go
|
||||||
|
template.go
|
||||||
|
|
||||||
|
feel.go
|
||||||
|
draw.go
|
||||||
|
data.go
|
||||||
|
word.go
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user