1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-12-25 23:19:57 +08:00
parent 7e958b03fb
commit 1810041116

View File

@ -151,8 +151,7 @@ func init() {
func Opens(m *ice.Message, arg ...string) { func Opens(m *ice.Message, arg ...string) {
if !tcp.IsLocalHost(m, m.Option(ice.MSG_USERIP)) { if !tcp.IsLocalHost(m, m.Option(ice.MSG_USERIP)) {
return return
} } else if len(arg) == 0 || arg[0] == "" {
if len(arg) == 0 || arg[0] == "" {
return return
} }
switch runtime.GOOS { switch runtime.GOOS {
@ -173,11 +172,10 @@ func Opens(m *ice.Message, arg ...string) {
func OpenCmds(m *ice.Message, arg ...string) *ice.Message { func OpenCmds(m *ice.Message, arg ...string) *ice.Message {
if !tcp.IsLocalHost(m, m.Option(ice.MSG_USERIP)) { if !tcp.IsLocalHost(m, m.Option(ice.MSG_USERIP)) {
return m return m
} } else if len(arg) == 0 || arg[0] == "" {
if len(arg) == 0 || arg[0] == "" {
return m 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 return m
} }
func TellApp(m *ice.Message, app string, arg ...string) { func TellApp(m *ice.Message, app string, arg ...string) {