mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
opt some
This commit is contained in:
parent
735328816b
commit
8fd16ff52c
@ -140,11 +140,13 @@ func init() {
|
||||
cli.CMD, []interface{}{"ice.bin", SPACE, tcp.DIAL},
|
||||
cli.ENV, kit.Dict(ice.CTX_LOG, ice.BIN_BOOTLOG),
|
||||
"miss", `#!/bin/bash
|
||||
[ -f $PWD/.ish/plug.sh ] || [ -f $HOME/.ish/plug.sh ] || git clone ${ISH_CONF_HUB_PROXY:="https://"}shylinux.com/x/intshell $PWD/.ish
|
||||
[ "$ISH_CONF_PRE" != "" ] || source $PWD/.ish/plug.sh || source $HOME/.ish/plug.sh
|
||||
require miss.sh
|
||||
if [ "$ISH_CONF_PRE" = "" ]; then
|
||||
[ -f $PWD/.ish/plug.sh ] || [ -f $HOME/.ish/plug.sh ] || git clone ${ISH_CONF_HUB_PROXY:="https://"}shylinux.com/x/intshell $PWD/.ish
|
||||
source $PWD/.ish/plug.sh || source $HOME/.ish/plug.sh
|
||||
fi
|
||||
|
||||
# ish_miss_prepare_compile
|
||||
require miss.sh
|
||||
ish_miss_prepare_compile
|
||||
ish_miss_prepare_develop
|
||||
ish_miss_prepare_install
|
||||
|
||||
|
@ -305,6 +305,9 @@ func init() {
|
||||
_share_repos(m, path.Join(arg[0], arg[1], arg[2]), arg[3:]...)
|
||||
}},
|
||||
"/help/": {Name: "/help/", Help: "帮助", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
if len(arg) == 0 {
|
||||
arg = append(arg, "tutor.shy")
|
||||
}
|
||||
if len(arg) > 0 && arg[0] != ctx.ACTION {
|
||||
arg[0] = "src/help/" + arg[0]
|
||||
}
|
||||
|
@ -281,13 +281,15 @@ func init() {
|
||||
|
||||
switch kind {
|
||||
case CHROME: // 交互节点
|
||||
switch m.Option("cmd") {
|
||||
case "pwd":
|
||||
m.Go(func(msg *ice.Message) {
|
||||
m.Go(func(msg *ice.Message) {
|
||||
switch m.Option("cmd") {
|
||||
case "pwd":
|
||||
link := kit.MergeURL(_space_domain(msg), "grant", name)
|
||||
msg.Sleep("100ms").Cmd(SPACE, name, "pwd", name, link, msg.Cmdx(cli.QRCODE, link))
|
||||
})
|
||||
}
|
||||
default:
|
||||
msg.Sleep("100ms").Cmd(SPACE, name, "pwd", name)
|
||||
}
|
||||
})
|
||||
case WORKER: // 工作节点
|
||||
m.Event(DREAM_START, args...)
|
||||
defer m.Event(DREAM_STOP, args...)
|
||||
|
@ -88,6 +88,10 @@ func _spide_show(m *ice.Message, arg ...string) {
|
||||
return
|
||||
}
|
||||
|
||||
for k, v := range res.Header {
|
||||
m.Debug("%v: %v", k, v)
|
||||
}
|
||||
|
||||
// 检查结果
|
||||
defer res.Body.Close()
|
||||
m.Cost(kit.MDB_STATUS, res.Status, kit.MDB_SIZE, res.Header.Get(ContentLength), kit.MDB_TYPE, res.Header.Get(ContentType))
|
||||
@ -108,6 +112,7 @@ func _spide_show(m *ice.Message, arg ...string) {
|
||||
m.Warn(true, ice.ErrNotRight, " of ", uri)
|
||||
return
|
||||
default:
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
8
misc.go
8
misc.go
@ -466,3 +466,11 @@ func (m *Message) SetResult() {
|
||||
m.Set(MSG_RESULT)
|
||||
return
|
||||
}
|
||||
|
||||
func (m *Message) AppendTrans(cb func(value string, key string, index int) string) {
|
||||
for _, k := range m.meta[MSG_APPEND] {
|
||||
for i, v := range m.meta[k] {
|
||||
m.meta[k][i] = cb(v, k, i)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -67,15 +67,16 @@ func _status_list(m *ice.Message) (files, adds, dels int, last time.Time) {
|
||||
m.Push(kit.MDB_NAME, value[kit.MDB_NAME])
|
||||
m.Push(kit.MDB_TYPE, vs[0])
|
||||
m.Push(kit.MDB_FILE, vs[1])
|
||||
m.Push("tags", tags)
|
||||
|
||||
list := []string{}
|
||||
switch vs[0] {
|
||||
case "##":
|
||||
m.Push("tags", tags)
|
||||
if strings.Contains(vs[1], "ahead") {
|
||||
list = append(list, PUSH)
|
||||
}
|
||||
default:
|
||||
m.Push("tags", "")
|
||||
if strings.Contains(vs[0], "??") {
|
||||
list = append(list, ADD)
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user