From b825c83e3a1c538e0f9030f9905e1ed18268032a Mon Sep 17 00:00:00 2001 From: harveyshao Date: Tue, 21 Feb 2023 13:26:41 +0800 Subject: [PATCH] opt intshell --- base/cli/forever.go | 5 ----- base/web/serve.go | 2 +- core/code/publish.go | 14 +++++++------- init.go | 3 +++ 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/base/cli/forever.go b/base/cli/forever.go index 0dfae6bf..d91f201b 100644 --- a/base/cli/forever.go +++ b/base/cli/forever.go @@ -3,7 +3,6 @@ package cli import ( "os" "path" - "runtime" ice "shylinux.com/x/icebergs" "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", "bin/boot.log", path.Join(back, "boot.log"), ice.Maps{CMD_OUTPUT: ""}) } - if runtime.GOOS == "windows" { - m.Sleep("3s") - break - } } }}, }) diff --git a/base/web/serve.go b/base/web/serve.go index bb77d493..fa28d398 100644 --- a/base/web/serve.go +++ b/base/web/serve.go @@ -179,7 +179,7 @@ func init() { }}, SERVE_START: {Hand: func(m *ice.Message, arg ...string) { 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 { case cli.WINDOWS: diff --git a/core/code/publish.go b/core/code/publish.go index 100b447d..01a84c5d 100644 --- a/core/code/publish.go +++ b/core/code/publish.go @@ -121,26 +121,26 @@ func init() { var _contexts = kit.Dict( ice.MISC, ` # 下载应用 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 -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, ` # 下载命令 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 -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 -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, ` # 下载源码 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 -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 `, ) diff --git a/init.go b/init.go index a038417b..e84de1e3 100644 --- a/init.go +++ b/init.go @@ -108,6 +108,9 @@ func Run(arg ...string) string { } switch Index.Merge(Index).Begin(Pulse, arg...); kit.Select("", arg, 0) { case SERVE, SPACE: + if os.Getenv("ctx_log") == "" { + logs.Disable(true) + } if Index.Start(Pulse, arg...) { conf.Wait() os.Exit(kit.Int(Pulse.Option(EXIT)))