mirror of
https://shylinux.com/x/icebergs
synced 2025-06-26 18:37:29 +08:00
opt some
This commit is contained in:
parent
cc0aac50ef
commit
f0ce8e75ef
@ -76,7 +76,7 @@ func _system_exec(m *ice.Message, cmd *exec.Cmd) {
|
|||||||
m.Push(kit.MDB_CODE, int(cmd.ProcessState.ExitCode()))
|
m.Push(kit.MDB_CODE, int(cmd.ProcessState.ExitCode()))
|
||||||
}
|
}
|
||||||
func IsSuccess(m *ice.Message) bool {
|
func IsSuccess(m *ice.Message) bool {
|
||||||
return m.Append(kit.MDB_CODE) == "0"
|
return m.Append(kit.MDB_CODE) == "0" || m.Append(kit.MDB_CODE) == ""
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -56,7 +56,8 @@ 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) {
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
m.Option(nfs.DIR_ROOT, m.Conf(cli.DAEMON, kit.META_PATH))
|
m.Option(nfs.DIR_ROOT, m.Conf(cli.DAEMON, kit.META_PATH))
|
||||||
m.Cmd(nfs.DIR, "./").Table(func(index int, value map[string]string, head []string) {
|
m.Cmd(nfs.DIR, "./", "time,path,size").Table(func(index int, value map[string]string, head []string) {
|
||||||
|
m.Debug("what %v", value)
|
||||||
m.Push(kit.MDB_TIME, value[kit.MDB_TIME])
|
m.Push(kit.MDB_TIME, value[kit.MDB_TIME])
|
||||||
m.Push(PORT, path.Base(value[kit.MDB_PATH]))
|
m.Push(PORT, path.Base(value[kit.MDB_PATH]))
|
||||||
m.Push(kit.MDB_SIZE, value[kit.MDB_SIZE])
|
m.Push(kit.MDB_SIZE, value[kit.MDB_SIZE])
|
||||||
|
@ -37,7 +37,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p := path.Join(m.Config(kit.MDB_PATH), path.Join(arg...))
|
p := path.Join(m.Config(kit.MDB_PATH), path.Join(arg...))
|
||||||
if mdb.HashSelect(m, kit.Ext(m.R.URL.Path)).Table(func(index int, value map[string]string, head []string) {
|
if mdb.HashSelect(m.Spawn(), kit.Ext(m.R.URL.Path)).Table(func(index int, value map[string]string, head []string) {
|
||||||
m.RenderCmd(value[kit.MDB_NAME], p)
|
m.RenderCmd(value[kit.MDB_NAME], p)
|
||||||
}).Length() > 0 {
|
}).Length() > 0 {
|
||||||
return // 插件
|
return // 插件
|
||||||
|
@ -109,7 +109,6 @@ func init() {
|
|||||||
return // 没有授权
|
return // 没有授权
|
||||||
}
|
}
|
||||||
|
|
||||||
m.Debug("what %v-------", arg)
|
|
||||||
switch kit.Select("", arg, 1) {
|
switch kit.Select("", arg, 1) {
|
||||||
case STORM, OCEAN, NODE:
|
case STORM, OCEAN, NODE:
|
||||||
m.Option(ice.MSG_RIVER, arg[0])
|
m.Option(ice.MSG_RIVER, arg[0])
|
||||||
@ -129,6 +128,9 @@ func init() {
|
|||||||
case cli.START:
|
case cli.START:
|
||||||
m.Cmdy(web.DREAM, ctx.ACTION, mdb.INPUTS, arg)
|
m.Cmdy(web.DREAM, ctx.ACTION, mdb.INPUTS, arg)
|
||||||
return
|
return
|
||||||
|
case "创建空间":
|
||||||
|
m.Cmdy(web.DREAM, ctx.ACTION, mdb.INPUTS, arg)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
switch arg[0] {
|
switch arg[0] {
|
||||||
|
@ -157,11 +157,11 @@ func init() {
|
|||||||
_defs(m, kit.MDB_KEY, kit.Keys("web.code", m.Option(kit.MDB_ZONE), m.Option(kit.MDB_NAME)))
|
_defs(m, kit.MDB_KEY, kit.Keys("web.code", m.Option(kit.MDB_ZONE), m.Option(kit.MDB_NAME)))
|
||||||
switch m.Option(kit.MDB_TYPE) {
|
switch m.Option(kit.MDB_TYPE) {
|
||||||
case "Zone":
|
case "Zone":
|
||||||
_defs(m, "list", "list zone id auto insert")
|
_defs(m, "list", m.Option(kit.MDB_NAME)+" zone id auto insert")
|
||||||
case "Hash":
|
case "Hash":
|
||||||
_defs(m, "list", "list hash auto create")
|
_defs(m, "list", m.Option(kit.MDB_NAME)+" hash auto create")
|
||||||
case "Data":
|
case "Data":
|
||||||
_defs(m, "list", "list path auto upload")
|
_defs(m, "list", m.Option(kit.MDB_NAME)+" path auto upload")
|
||||||
}
|
}
|
||||||
m.Option("tag", kit.Format("`name:\"%s\" help:\"%s\"`", m.Option("list"), m.Option("help")))
|
m.Option("tag", kit.Format("`name:\"%s\" help:\"%s\"`", m.Option("list"), m.Option("help")))
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 交叉编译
|
// 交叉编译
|
||||||
main := ice.SRC_MAIN_GO
|
main, file := ice.SRC_MAIN_GO, ""
|
||||||
goos := m.Conf(cli.RUNTIME, kit.Keys(tcp.HOST, cli.GOOS))
|
goos := m.Conf(cli.RUNTIME, kit.Keys(tcp.HOST, cli.GOOS))
|
||||||
arch := m.Conf(cli.RUNTIME, kit.Keys(tcp.HOST, cli.GOARCH))
|
arch := m.Conf(cli.RUNTIME, kit.Keys(tcp.HOST, cli.GOARCH))
|
||||||
for _, k := range arg {
|
for _, k := range arg {
|
||||||
@ -48,11 +48,15 @@ func init() {
|
|||||||
default:
|
default:
|
||||||
if kit.Ext(k) == GO {
|
if kit.Ext(k) == GO {
|
||||||
main = k
|
main = k
|
||||||
|
} else {
|
||||||
|
file = k
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file := path.Join(kit.Select("", m.Config(nfs.PATH), m.Option(cli.CMD_DIR) == ""),
|
if file == "" {
|
||||||
|
file = path.Join(kit.Select("", m.Config(nfs.PATH), m.Option(cli.CMD_DIR) == ""),
|
||||||
kit.Keys(kit.Select(ice.ICE, kit.TrimExt(main), main != ice.SRC_MAIN_GO), goos, arch))
|
kit.Keys(kit.Select(ice.ICE, kit.TrimExt(main), main != ice.SRC_MAIN_GO), goos, arch))
|
||||||
|
}
|
||||||
|
|
||||||
// 执行编译
|
// 执行编译
|
||||||
_autogen_version(m.Spawn())
|
_autogen_version(m.Spawn())
|
||||||
|
@ -43,9 +43,8 @@ func init() {
|
|||||||
m.ProcessInner()
|
m.ProcessInner()
|
||||||
}},
|
}},
|
||||||
COMPILE: {Name: "compile", Help: "编译", Hand: func(m *ice.Message, arg ...string) {
|
COMPILE: {Name: "compile", Help: "编译", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(COMPILE, ice.SRC_MAIN_GO)
|
if m.Cmdy(COMPILE, ice.SRC_MAIN_GO); cli.IsSuccess(m) {
|
||||||
m.Cmdy(nfs.LINK, ice.BIN_ICE_BIN, m.Append(nfs.PATH))
|
m.Cmd(COMPILE, ice.SRC_MAIN_GO, ice.BIN_ICE_BIN)
|
||||||
if cli.IsSuccess(m) {
|
|
||||||
m.Cmd(ice.EXIT, "1")
|
m.Cmd(ice.EXIT, "1")
|
||||||
}
|
}
|
||||||
m.ProcessInner()
|
m.ProcessInner()
|
||||||
|
2
data.go
2
data.go
@ -9,7 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (m *Message) CommandKey() string {
|
func (m *Message) CommandKey() string {
|
||||||
return strings.TrimSuffix(strings.TrimPrefix(m._key, "/"), "/")
|
return strings.TrimSuffix(strings.TrimPrefix(m._key, PS), PS)
|
||||||
}
|
}
|
||||||
func (m *Message) PrefixKey(arg ...string) string {
|
func (m *Message) PrefixKey(arg ...string) string {
|
||||||
return kit.Keys(m.Cap(CTX_FOLLOW), m.CommandKey(), arg)
|
return kit.Keys(m.Cap(CTX_FOLLOW), m.CommandKey(), arg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user