1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-07-03 19:24:34 +08:00
parent e6c64b7e1f
commit 4dcb03c9dc

View File

@ -6,16 +6,17 @@ import (
"shylinux.com/x/icebergs/base/ctx" "shylinux.com/x/icebergs/base/ctx"
"shylinux.com/x/icebergs/base/nfs" "shylinux.com/x/icebergs/base/nfs"
"shylinux.com/x/icebergs/base/web" "shylinux.com/x/icebergs/base/web"
kit "shylinux.com/x/toolkits"
) )
func init() { func init() {
Index.MergeCommands(ice.Commands{ Index.MergeCommands(ice.Commands{
nfs.SOURCE: {Name: "source repos path file auto", Actions: ice.Actions{ nfs.SOURCE: {Name: "source repos path file auto", Actions: ice.Actions{
CLONE: {Hand: func(m *ice.Message, arg ...string) { CLONE: {Hand: func(m *ice.Message, arg ...string) {
if _, err := git.PlainClone(m.Option(nfs.PATH), false, &git.CloneOptions{URL: m.Option(REPOS)}); !m.WarnNotValid(err) { kit.If(!kit.HasPrefix(m.Option(REPOS), "http"), func() { m.Option(REPOS, "https://"+m.Option(REPOS)) })
return if _, err := git.PlainClone(m.Option(nfs.PATH), false, &git.CloneOptions{URL: m.Option(REPOS)}); m.WarnNotValid(err) {
m.ProcessRefresh()
} }
m.ProcessRefresh()
}}, }},
}, Hand: func(m *ice.Message, arg ...string) { }, Hand: func(m *ice.Message, arg ...string) {
if len(arg) < 3 || arg[0] == ctx.ACTION { if len(arg) < 3 || arg[0] == ctx.ACTION {