mirror of
https://shylinux.com/x/icebergs
synced 2025-04-28 02:02:02 +08:00
opt some
This commit is contained in:
parent
c42444ccf5
commit
8d82f56bf9
@ -26,6 +26,8 @@ func init() {
|
||||
}
|
||||
}
|
||||
println(kit.Format("%s run %s", kit.Now(), kit.Join(arg, ice.SP)))
|
||||
m.Option(CMD_OUTPUT, os.Stdout)
|
||||
m.Option(CMD_ERRPUT, os.Stderr)
|
||||
switch msg := m.Cmd(SYSTEM, arg); msg.Append(CODE) {
|
||||
case "0":
|
||||
println(kit.Format("%s exit", kit.Now()))
|
||||
|
@ -109,6 +109,9 @@ func _system_exec(m *ice.Message, cmd *exec.Cmd) {
|
||||
func IsSuccess(m *ice.Message) bool {
|
||||
return m.Append(CODE) == "0" || m.Append(CODE) == ""
|
||||
}
|
||||
func SystemFind(m *ice.Message, bin string, dir ...string) string {
|
||||
return _system_find(m, bin, dir...)
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_DIR = "cmd_dir"
|
||||
|
@ -88,7 +88,8 @@ func _dream_show(m *ice.Message, name string) {
|
||||
m.Optionv(cli.CMD_OUTPUT, path.Join(p, m.Config(kit.Keys(cli.ENV, cli.CTX_LOG))))
|
||||
|
||||
// 启动任务
|
||||
m.Cmd(cli.DAEMON, kit.Path(os.Args[0]), SPACE, tcp.DIAL, ice.DEV, ice.OPS, mdb.NAME, name, m.OptionSimple(RIVER))
|
||||
bin := cli.SystemFind(m, "ice.bin", kit.Path(path.Join(p, ice.BIN)), "./bin")
|
||||
m.Cmd(cli.DAEMON, kit.Select(kit.Path(os.Args[0]), bin), SPACE, tcp.DIAL, ice.DEV, ice.OPS, mdb.NAME, name, m.OptionSimple(RIVER))
|
||||
defer m.Event(DREAM_CREATE, kit.SimpleKV("", m.Option(mdb.TYPE), name)...)
|
||||
m.Sleep3s()
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ func init() {
|
||||
if m.Cmdx(cli.SYSTEM, nfs.FIND, "go") == "" {
|
||||
m.Cmd(INSTALL, COMPILE)
|
||||
}
|
||||
m.Cmd(cli.SYSTEM, "go", "get", "shylinux.com/x/ice")
|
||||
|
||||
// 交叉编译
|
||||
main, file := ice.SRC_MAIN_GO, ""
|
||||
|
@ -184,7 +184,6 @@ func init() {
|
||||
switch {
|
||||
case strings.Contains(osid, cli.ALPINE):
|
||||
m.Cmd(cli.SYSTEM, "apk", "add", "git", "go")
|
||||
m.Cmd(cli.SYSTEM, "go", "get", "shylinux.com/x/ice")
|
||||
case strings.Contains(osid, cli.CENTOS):
|
||||
m.Cmdy(INSTALL, web.DOWNLOAD, "https://golang.google.cn/dl/go1.15.5.linux-amd64.tar.gz", ice.USR_LOCAL)
|
||||
|
||||
|
@ -39,6 +39,7 @@ func init() {
|
||||
m.Cmd(nfs.COPY, ice.GO_MOD, path.Join(ice.SRC_DEBUG, ice.GO_MOD))
|
||||
m.Cmd(nfs.COPY, ice.GO_SUM, path.Join(ice.SRC_DEBUG, ice.GO_SUM))
|
||||
m.Cmdy(WEBPACK, mdb.REMOVE)
|
||||
m.ToastSuccess()
|
||||
m.ProcessHold()
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Cmdy(INNER, arg) }},
|
||||
|
Loading…
x
Reference in New Issue
Block a user