1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-27 17:58:29 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2022-02-14 13:04:38 +08:00
parent c42444ccf5
commit 8d82f56bf9
6 changed files with 9 additions and 2 deletions

View File

@ -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()))

View File

@ -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"

View File

@ -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()
}

View File

@ -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, ""

View File

@ -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)

View File

@ -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) }},