From cf36511cc5aad1d3abd27ea378139233a070017f Mon Sep 17 00:00:00 2001 From: shylinux Date: Mon, 20 Feb 2023 19:42:40 +0800 Subject: [PATCH] opt some --- core/code/sh.go | 4 ++-- misc/git/server.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/code/sh.go b/core/code/sh.go index e6a768db..7ecc077d 100644 --- a/core/code/sh.go +++ b/core/code/sh.go @@ -23,7 +23,7 @@ func init() { mdb.RENDER: {Hand: func(m *ice.Message, arg ...string) { cmds, text := SH, kit.Format(_sh_template, m.Option(ice.MSG_USERHOST), m.Option(ice.MSG_USERPOD), path.Join(arg[2], arg[1])) if strings.HasPrefix(text, "#!") { - cmds = strings.TrimSpace(strings.SplitN(text, ice.NL, 2)[0][2:]) + // cmds = strings.TrimSpace(strings.SplitN(text, ice.NL, 2)[0][2:]) } _xterm_show(m, cmds, text) }}, @@ -37,5 +37,5 @@ func init() { var _sh_template = `#!/bin/sh export ctx_dev=%s ctx_pod=%s ctx_mod=%s -temp=$(mktemp); if curl -h &>/dev/null; then curl -o $temp -fsSL $ctx_dev; else wget -O $temp -q $ctx_dev; fi && source $temp $ctx_mod +temp=$(mktemp); if curl -V &>/dev/null; then curl -o $temp -fsSL $ctx_dev; else wget -O $temp -q $ctx_dev; fi && source $temp $ctx_mod ` diff --git a/misc/git/server.go b/misc/git/server.go index 87ae0942..6caf48ce 100644 --- a/misc/git/server.go +++ b/misc/git/server.go @@ -93,7 +93,7 @@ const SERVER = "server" func init() { web.Index.MergeCommands(ice.Commands{"/x/": {Actions: ice.MergeActions(ctx.CmdAction(), aaa.WhiteAction(ctx.COMMAND, ice.RUN)), Hand: func(m *ice.Message, arg ...string) { - if !m.IsCliUA() { + if !m.IsCliUA() || strings.Contains(arg[0], ice.AT) { if strings.Contains(arg[0], ice.AT) { ls := strings.Split(arg[0], ice.AT) _repos_cat(m, path.Join(ice.USR_LOCAL_REPOS, ls[0]), "master", ls[1], path.Join(arg[1:]...))