forked from x/icebergs
add some
This commit is contained in:
parent
fd319e30e4
commit
e4d0d98702
@ -110,7 +110,7 @@ func init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
for i, v := range arg[1:] {
|
for i, v := range arg[1:] {
|
||||||
kit.Value(cmd.List, kit.Keys(i, "value"), v)
|
kit.Value(cmd.List, kit.Keys(i, mdb.VALUE), v)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}},
|
}},
|
||||||
|
@ -346,6 +346,8 @@ func init() {
|
|||||||
kit.If(m.Option(mdb.NAME) == "", func() { m.Sleep("5s").Cmdy(ROUTE, cli.BUILD).ProcessInner() })
|
kit.If(m.Option(mdb.NAME) == "", func() { m.Sleep("5s").Cmdy(ROUTE, cli.BUILD).ProcessInner() })
|
||||||
}},
|
}},
|
||||||
"gowork": {Name: "gowork name", Help: "工作区", Hand: func(m *ice.Message, arg ...string) {
|
"gowork": {Name: "gowork name", Help: "工作区", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmd(cli.SYSTEM, cli.GO, "work", "init")
|
||||||
|
m.Cmd(cli.SYSTEM, cli.GO, "work", "use", ".")
|
||||||
DreamEach(m, m.Option(mdb.NAME), "", func(name string) {
|
DreamEach(m, m.Option(mdb.NAME), "", func(name string) {
|
||||||
m.Cmd(cli.SYSTEM, cli.GO, "work", "use", path.Join(ice.USR_LOCAL_WORK, name))
|
m.Cmd(cli.SYSTEM, cli.GO, "work", "use", path.Join(ice.USR_LOCAL_WORK, name))
|
||||||
})
|
})
|
||||||
|
@ -161,7 +161,7 @@ const CONNECT = "connect"
|
|||||||
func init() {
|
func init() {
|
||||||
psh.Index.MergeCommands(ice.Commands{
|
psh.Index.MergeCommands(ice.Commands{
|
||||||
CONNECT: {Help: "连接", Actions: ice.MergeActions(ice.Actions{
|
CONNECT: {Help: "连接", Actions: ice.MergeActions(ice.Actions{
|
||||||
tcp.OPEN: {Name: "open authfile username=shy host=shylinux.com port=22 cmds private=.ssh/id_rsa password verfiy", Help: "终端", Hand: func(m *ice.Message, arg ...string) {
|
tcp.OPEN: {Name: "open authfile username=shy host=shylinux.com port=22 cmds init private=.ssh/id_rsa password verfiy", Help: "终端", Hand: func(m *ice.Message, arg ...string) {
|
||||||
if m.Option(ctx.CMDS) == "" {
|
if m.Option(ctx.CMDS) == "" {
|
||||||
defer nfs.OptionLoad(m, m.Option(AUTHFILE)).Echo("exit %s@%s:%s\n", m.Option(aaa.USERNAME), m.Option(tcp.HOST), m.Option(tcp.PORT))
|
defer nfs.OptionLoad(m, m.Option(AUTHFILE)).Echo("exit %s@%s:%s\n", m.Option(aaa.USERNAME), m.Option(tcp.HOST), m.Option(tcp.PORT))
|
||||||
_ssh_open(m.SetResult(), arg...)
|
_ssh_open(m.SetResult(), arg...)
|
||||||
|
@ -164,7 +164,11 @@ func (s relay) Publish(m *ice.Message, arg ...string) {
|
|||||||
m.Cmdy(nfs.DIR, ice.USR_PUBLISH).PushAction()
|
m.Cmdy(nfs.DIR, ice.USR_PUBLISH).PushAction()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
m.Cmd(nfs.SAVE, kit.HomePath(".ssh/"+m.Option(MACHINE)+".json"), kit.Formats(kit.Dict(m.OptionSimple("username,host,port")))+ice.NL)
|
if m.Option(ice.INIT, ""); m.Option(web.PORTAL) != "" {
|
||||||
|
m.Option(ice.INIT, kit.Format("cd %s", path.Base(m.DreamPath(m.Option(web.DREAM)))))
|
||||||
|
}
|
||||||
|
m.Debug("what %v", m.Option(web.PORTAL))
|
||||||
|
m.Cmd(nfs.SAVE, kit.HomePath(".ssh/"+m.Option(MACHINE)+".json"), kit.Formats(kit.Dict(m.OptionSimple("username,host,port,init")))+ice.NL)
|
||||||
kit.If(!m.Exists(path.Join(ice.USR_PUBLISH, RELAY)), func() { s.Compile(m) })
|
kit.If(!m.Exists(path.Join(ice.USR_PUBLISH, RELAY)), func() { s.Compile(m) })
|
||||||
os.Symlink(RELAY, ice.USR_PUBLISH+m.Option(MACHINE))
|
os.Symlink(RELAY, ice.USR_PUBLISH+m.Option(MACHINE))
|
||||||
}
|
}
|
||||||
|
6
type.go
6
type.go
@ -342,7 +342,11 @@ func (m *Message) Search(key string, cb Any) *Message {
|
|||||||
}
|
}
|
||||||
key = ls[len(ls)-1]
|
key = ls[len(ls)-1]
|
||||||
} else if ctx, ok := Info.Index[key].(*Context); ok {
|
} else if ctx, ok := Info.Index[key].(*Context); ok {
|
||||||
p = ctx
|
if _, ok := m.target.Commands[key]; ok {
|
||||||
|
p = m.target
|
||||||
|
} else {
|
||||||
|
p = ctx
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
p = m.target
|
p = m.target
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user