1
0
forked from x/icebergs

opt intshell

This commit is contained in:
harveyshao 2023-02-21 13:26:41 +08:00
parent cf36511cc5
commit b825c83e3a
4 changed files with 11 additions and 13 deletions

View File

@ -3,7 +3,6 @@ package cli
import ( import (
"os" "os"
"path" "path"
"runtime"
ice "shylinux.com/x/icebergs" ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/gdb" "shylinux.com/x/icebergs/base/gdb"
@ -65,10 +64,6 @@ func init() {
m.Cmd(SYSTEM, "cp", "-r", "var/log", back, ice.Maps{CMD_OUTPUT: ""}) m.Cmd(SYSTEM, "cp", "-r", "var/log", back, ice.Maps{CMD_OUTPUT: ""})
m.Cmd(SYSTEM, "cp", "bin/boot.log", path.Join(back, "boot.log"), ice.Maps{CMD_OUTPUT: ""}) m.Cmd(SYSTEM, "cp", "bin/boot.log", path.Join(back, "boot.log"), ice.Maps{CMD_OUTPUT: ""})
} }
if runtime.GOOS == "windows" {
m.Sleep("3s")
break
}
} }
}}, }},
}) })

View File

@ -179,7 +179,7 @@ func init() {
}}, }},
SERVE_START: {Hand: func(m *ice.Message, arg ...string) { SERVE_START: {Hand: func(m *ice.Message, arg ...string) {
if domain := m.Cmdx(SPACE, DOMAIN); ice.Info.Colors { if domain := m.Cmdx(SPACE, DOMAIN); ice.Info.Colors {
m.Sleep30ms().Cmd(ssh.PRINTF, kit.Dict(nfs.CONTENT, "\r"+ice.Render(m, ice.RENDER_QRCODE, domain)+ice.NL)).Cmd(ssh.PROMPT) m.Sleep30ms().Cmd(ssh.PRINTF, kit.Dict(nfs.CONTENT, "\r"+ice.Render(m, ice.RENDER_QRCODE, domain))).Cmd(ssh.PROMPT)
} }
switch runtime.GOOS { switch runtime.GOOS {
case cli.WINDOWS: case cli.WINDOWS:

View File

@ -121,26 +121,26 @@ func init() {
var _contexts = kit.Dict( var _contexts = kit.Dict(
ice.MISC, ` ice.MISC, `
# 下载应用 wget Alpine / Busybox # 下载应用 wget Alpine / Busybox
export ctx_dev={{.Option "domain"}}{{.Option "ctx_env"}}; ctx_temp=$(mktemp); wget -O $ctx_temp -q $ctx_dev; source $ctx_temp app username {{.Option "user.name"}} usernick {{.Option "user.nick"}} export ctx_dev={{.Option "domain"}}{{.Option "ctx_env"}}; temp=$(mktemp); wget -O $temp -q $ctx_dev; source $temp app username {{.Option "user.name"}} usernick {{.Option "user.nick"}}
# 下载应用 curl Centos / MacOS # 下载应用 curl Centos / MacOS
export ctx_dev={{.Option "domain"}}{{.Option "ctx_env"}}; ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL $ctx_dev; source $ctx_temp app username {{.Option "user.name"}} usernick {{.Option "user.nick"}} export ctx_dev={{.Option "domain"}}{{.Option "ctx_env"}}; temp=$(mktemp); curl -o $temp -fsSL $ctx_dev; source $temp app username {{.Option "user.name"}} usernick {{.Option "user.nick"}}
`, `,
ice.CORE, ` ice.CORE, `
# 下载命令 wget Busybox # 下载命令 wget Busybox
ctx_temp=$(mktemp); wget -O $ctx_temp -q http://shylinux.com; source $ctx_temp binary temp=$(mktemp); wget -O $temp -q http://shylinux.com; source $temp binary
# 下载命令 wget Alpine # 下载命令 wget Alpine
ctx_temp=$(mktemp); wget -O $ctx_temp -q {{.Option "domain"}}; source $ctx_temp binary temp=$(mktemp); wget -O $temp -q {{.Option "domain"}}; source $temp binary
# 下载命令 curl Centos / MacOS # 下载命令 curl Centos / MacOS
ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL {{.Option "domain"}}; source $ctx_temp binary temp=$(mktemp); curl -o $temp -fsSL {{.Option "domain"}}; source $temp binary
`, `,
ice.BASE, ` ice.BASE, `
# 下载源码 wget Alpine # 下载源码 wget Alpine
ctx_temp=$(mktemp); wget -O $ctx_temp -q {{.Option "domain"}}; source $ctx_temp source temp=$(mktemp); wget -O $temp -q {{.Option "domain"}}; source $temp source
# 下载源码 curl Centos / MacOS # 下载源码 curl Centos / MacOS
ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL {{.Option "domain"}}; source $ctx_temp source temp=$(mktemp); curl -o $temp -fsSL {{.Option "domain"}}; source $temp source
`, `,
) )

View File

@ -108,6 +108,9 @@ func Run(arg ...string) string {
} }
switch Index.Merge(Index).Begin(Pulse, arg...); kit.Select("", arg, 0) { switch Index.Merge(Index).Begin(Pulse, arg...); kit.Select("", arg, 0) {
case SERVE, SPACE: case SERVE, SPACE:
if os.Getenv("ctx_log") == "" {
logs.Disable(true)
}
if Index.Start(Pulse, arg...) { if Index.Start(Pulse, arg...) {
conf.Wait() conf.Wait()
os.Exit(kit.Int(Pulse.Option(EXIT))) os.Exit(kit.Int(Pulse.Option(EXIT)))