forked from x/icebergs
add some
This commit is contained in:
parent
da81284b37
commit
8a27ce7d66
@ -193,6 +193,7 @@ const (
|
||||
SHARE_LOCAL = "/share/local/"
|
||||
PATHNAME = "pathname"
|
||||
FILENAME = "filename"
|
||||
CONTEXTS = "contexts"
|
||||
|
||||
TYPE_ALL = "all"
|
||||
TYPE_BIN = "bin"
|
||||
|
@ -462,7 +462,7 @@ func init() {
|
||||
m.Cmdy(arg[1:])
|
||||
return
|
||||
}
|
||||
if kit.IsIn(arg[0], "", ice.CONTEXTS, ice.Info.NodeName) {
|
||||
if kit.IsIn(arg[0], "", ice.Info.NodeName) {
|
||||
m.Cmdy(arg[1:])
|
||||
return
|
||||
}
|
||||
|
18
conf.go
18
conf.go
@ -62,15 +62,15 @@ const (
|
||||
)
|
||||
const ( // REPOS
|
||||
CONTEXTOS = "ContextOS"
|
||||
CONTEXTS = "contexts"
|
||||
INTSHELL = "intshell"
|
||||
LEARNING = "learning"
|
||||
VOLCANOS = "volcanos"
|
||||
TOOLKITS = "toolkits"
|
||||
ICEBERGS = "icebergs"
|
||||
RELEASE = "release"
|
||||
MATRIX = "matrix"
|
||||
ICONS = "icons"
|
||||
// CONTEXTS = "contexts"
|
||||
INTSHELL = "intshell"
|
||||
LEARNING = "learning"
|
||||
VOLCANOS = "volcanos"
|
||||
TOOLKITS = "toolkits"
|
||||
ICEBERGS = "icebergs"
|
||||
RELEASE = "release"
|
||||
MATRIX = "matrix"
|
||||
ICONS = "icons"
|
||||
|
||||
INSTALL = "install"
|
||||
REQUIRE = "require"
|
||||
|
@ -129,7 +129,7 @@ func init() {
|
||||
m.Logs(nfs.SAVE, nfs.TARGET, file, nfs.SOURCE, main)
|
||||
m.Cmdy(nfs.DIR, file, "time,path,size,hash,link")
|
||||
web.MessageInsertJSON(m, cli.SYSTEM, "", m.Spawn().Copy(m).FormatMeta(), ctx.ARGS, m.Append(mdb.HASH))
|
||||
kit.If(!m.IsCliUA() && strings.Contains(file, ice.ICE), func() { m.Cmdy(PUBLISH, ice.CONTEXTS, ice.APP) })
|
||||
kit.If(!m.IsCliUA() && strings.Contains(file, ice.ICE), func() { m.Cmdy(PUBLISH, nfs.CONTEXTS, ice.APP) })
|
||||
web.Count(m, "", file)
|
||||
}
|
||||
}},
|
||||
|
@ -67,11 +67,12 @@ func _publish_contexts(m *ice.Message, arg ...string) {
|
||||
}
|
||||
if m.Option(ice.MSG_USERPOD) != "" {
|
||||
env = append(env, cli.CTX_POD, m.Option(ice.MSG_USERPOD))
|
||||
} else if name := msg.Append(nfs.PATHNAME); !kit.IsIn(name, path.Base(m.Option(nfs.SOURCE)), ice.CONTEXTS) {
|
||||
} else if name := msg.Append(nfs.PATHNAME); !kit.IsIn(name, path.Base(m.Option(nfs.SOURCE))) {
|
||||
env = append(env, cli.CTX_NAME, name)
|
||||
}
|
||||
case cli.CURL, cli.WGET:
|
||||
}
|
||||
env = append(env, kit.Simple(m.Optionv(cli.CTX_ENV))...)
|
||||
kit.If(len(env) > 0, func() { m.Options(cli.CTX_ENV, lex.SP+kit.JoinKV(mdb.EQ, lex.SP, env...)) })
|
||||
if template := strings.TrimSpace(nfs.Template(m, kit.Keys(k, SH))); m.Option(nfs.FORMAT) == "raw" {
|
||||
m.Echo(template)
|
||||
@ -93,9 +94,9 @@ func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
PUBLISH: {Name: "publish path auto create volcanos icebergs intshell", Help: "发布", Icon: "QuickTime Player.png", Role: aaa.VOID, Actions: ice.MergeActions(ice.Actions{
|
||||
ice.VOLCANOS: {Help: "火山架", Hand: func(m *ice.Message, arg ...string) { _publish_list(m, kit.ExtReg(HTML, CSS, JS)) }},
|
||||
ice.ICEBERGS: {Help: "冰山架", Hand: func(m *ice.Message, arg ...string) { _publish_bin_list(m).Cmdy("", ice.CONTEXTS) }},
|
||||
ice.ICEBERGS: {Help: "冰山架", Hand: func(m *ice.Message, arg ...string) { _publish_bin_list(m).Cmdy("", nfs.CONTEXTS) }},
|
||||
ice.INTSHELL: {Help: "神农架", Hand: func(m *ice.Message, arg ...string) { _publish_list(m, kit.ExtReg(SH, VIM, CONF)) }},
|
||||
ice.CONTEXTS: {Hand: func(m *ice.Message, arg ...string) { _publish_contexts(m, arg...) }},
|
||||
nfs.CONTEXTS: {Hand: func(m *ice.Message, arg ...string) { _publish_contexts(m, arg...) }},
|
||||
nfs.SOURCE: {Hand: func(m *ice.Message, arg ...string) { _publish_contexts(m, nfs.SOURCE) }},
|
||||
nfs.BINARY: {Hand: func(m *ice.Message, arg ...string) { _publish_contexts(m, nfs.BINARY) }},
|
||||
cli.CURL: {Hand: func(m *ice.Message, arg ...string) { _publish_contexts(m, cli.CURL) }},
|
||||
@ -131,7 +132,7 @@ func init() {
|
||||
nfs.TRASH: {Hand: func(m *ice.Message, arg ...string) { nfs.Trash(m, path.Join(ice.USR_PUBLISH, m.Option(nfs.PATH))) }},
|
||||
}, ctx.ConfAction(mdb.FIELD, nfs.PATH)), Hand: func(m *ice.Message, arg ...string) {
|
||||
if m.Option(nfs.DIR_ROOT, ice.USR_PUBLISH); len(arg) == 0 {
|
||||
_publish_list(m).Cmdy("", ice.CONTEXTS, ice.APP)
|
||||
_publish_list(m).Cmdy("", nfs.CONTEXTS, ice.APP)
|
||||
} else {
|
||||
m.Cmdy(nfs.DIR, arg[0], "time,path,size,hash,link,action", ice.OptionFields(mdb.DETAIL))
|
||||
web.PushImages(m, web.P(PUBLISH, arg[0]))
|
||||
|
@ -202,7 +202,7 @@ func init() {
|
||||
m.Push(nfs.SIZE, kit.Split(m.Cmdx(cli.SYSTEM, "du", "-sh", path.Join(ice.USR_LOCAL_REPOS, value[REPOS])))[0])
|
||||
m.PushScript(kit.Format("git clone %s", _service_link(m, value[REPOS])))
|
||||
}).Sort(REPOS)
|
||||
kit.If(!m.IsCliUA(), func() { m.Cmdy(web.CODE_PUBLISH, ice.CONTEXTS, ice.DEV) })
|
||||
kit.If(!m.IsCliUA(), func() { m.Cmdy(web.CODE_PUBLISH, nfs.CONTEXTS, ice.DEV) })
|
||||
kit.If(mdb.Config(m, aaa.AUTH) == aaa.PRIVATE, func() { m.StatusTimeCount(aaa.AUTH, aaa.PRIVATE) })
|
||||
m.PushAction("settoken", mdb.REMOVE).Action(mdb.CREATE, aaa.AUTH)
|
||||
} else if repos := _repos_open(m, arg[0]); len(arg) == 1 {
|
||||
|
@ -93,7 +93,7 @@ func init() {
|
||||
} else {
|
||||
m.Action(PULL, PUSH, INSTEADOF, mdb.DEV_REQUEST, ctx.CONFIG, STASH)
|
||||
}
|
||||
kit.If(!m.IsCliUA(), func() { m.Cmdy(code.PUBLISH, ice.CONTEXTS, ice.DEV) })
|
||||
kit.If(!m.IsCliUA(), func() { m.Cmdy(code.PUBLISH, nfs.CONTEXTS, ice.DEV) })
|
||||
ctx.Toolkit(m)
|
||||
} else {
|
||||
_repos_cmd(m, arg[0], DIFF)
|
||||
|
Loading…
x
Reference in New Issue
Block a user