From f993fa4890abaf01581bc545412544f2074c4a6f Mon Sep 17 00:00:00 2001 From: harveyshao Date: Sun, 23 Jan 2022 10:51:57 +0800 Subject: [PATCH] opt some --- core/chat/header.go | 2 +- misc/git/git.go | 7 ++++++- type.go | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/chat/header.go b/core/chat/header.go index f4509a98..4254a6b7 100644 --- a/core/chat/header.go +++ b/core/chat/header.go @@ -89,7 +89,7 @@ func init() { switch arg[0] { case "/sso": return - case "/pod/": + case "/pod/", "/cmd/": return // 免登录 case "/header": switch kit.Select("", arg, 1) { diff --git a/misc/git/git.go b/misc/git/git.go index 70707840..5e87f4f1 100644 --- a/misc/git/git.go +++ b/misc/git/git.go @@ -16,7 +16,12 @@ var Index = &ice.Context{Name: GIT, Help: "代码库", Configs: map[string]*ice. nfs.SOURCE, "http://mirrors.tencent.com/macports/distfiles/git-cinnabar/git-2.31.1.tar.gz", )}, }, Commands: map[string]*ice.Command{ - GIT: {Name: "git path auto order build download", Help: "代码库", Action: ice.MergeAction(map[string]*ice.Action{ + GIT: {Name: "git path auto install order build download", Help: "代码库", Action: ice.MergeAction(map[string]*ice.Action{ + code.INSTALL: {Name: "install", Help: "安装", Hand: func(m *ice.Message, arg ...string) { + web.PushStream(m) + defer m.ProcessInner() + m.Cmdy(cli.SYSTEM, "yum", "install", "-y", "git") + }}, cli.ORDER: {Name: "order", Help: "加载", Hand: func(m *ice.Message, arg ...string) { m.Cmd(code.INSTALL, cli.ORDER, m.Config(nfs.SOURCE), "_install/bin") m.Cmdy(code.INSTALL, cli.ORDER, m.Config(nfs.SOURCE), "_install/libexec/git-core") diff --git a/type.go b/type.go index 8434300b..f5b4f279 100644 --- a/type.go +++ b/type.go @@ -134,7 +134,6 @@ func (c *Context) Merge(s *Context) *Context { if p, ok := c.Commands[k]; ok { switch last, next := p.Hand, a.Hand; k { case CTX_INIT: - fmt.Printf("what %v %v last: %v next: %v\n", s.Name, c.Name, kit.FileLine(last, 3), kit.FileLine(next, 3)) p.Hand = func(m *Message, c *Context, _key string, arg ...string) { last(m, c, _key, arg...) m._key, m._cmd = key, cmd