From 1810041116a06c5370936dda6f811d4524e27e8a Mon Sep 17 00:00:00 2001 From: shy Date: Mon, 25 Dec 2023 23:19:57 +0800 Subject: [PATCH] opt some --- base/cli/daemon.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/base/cli/daemon.go b/base/cli/daemon.go index 2e7ba76c..cb00867f 100644 --- a/base/cli/daemon.go +++ b/base/cli/daemon.go @@ -151,8 +151,7 @@ func init() { func Opens(m *ice.Message, arg ...string) { if !tcp.IsLocalHost(m, m.Option(ice.MSG_USERIP)) { return - } - if len(arg) == 0 || arg[0] == "" { + } else if len(arg) == 0 || arg[0] == "" { return } switch runtime.GOOS { @@ -173,11 +172,10 @@ func Opens(m *ice.Message, arg ...string) { func OpenCmds(m *ice.Message, arg ...string) *ice.Message { if !tcp.IsLocalHost(m, m.Option(ice.MSG_USERIP)) { return m - } - if len(arg) == 0 || arg[0] == "" { + } else if len(arg) == 0 || arg[0] == "" { return m } - TellApp(m, "Terminal", kit.Format(`do script %s`, strings.Join(arg, "; ")), "activate") + TellApp(m, "Terminal", kit.Format(`do script %q`, strings.Join(arg, "; ")), "activate") return m } func TellApp(m *ice.Message, app string, arg ...string) {