forked from x/icebergs
opt some
This commit is contained in:
parent
2f6795a70e
commit
d517ee6ebe
@ -208,21 +208,14 @@ func init() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var bind = []string{
|
|
||||||
"usr/icebergs/core/chat/", "usr/volcanos/panel/",
|
|
||||||
"usr/icebergs/core/", "usr/volcanos/plugin/local/",
|
|
||||||
}
|
|
||||||
|
|
||||||
func Relative(m *ice.Message, p string) string {
|
func Relative(m *ice.Message, p string) string {
|
||||||
p = kit.TrimPrefix(p, kit.Path("")+PS)
|
if _p := kit.ExtChange(p, JS); Exists(m, _p) {
|
||||||
for i := 0; i < len(bind); i += 2 {
|
return _p
|
||||||
if strings.HasPrefix(p, bind[i]) {
|
} else if _p := kit.ExtChange(path.Join(ice.USR_VOLCANOS, "plugin/local", path.Join(kit.Slice(kit.Split(p, "/"), -2)...)), JS); Exists(m, _p) {
|
||||||
if _p := kit.ExtChange(strings.Replace(p, bind[i], bind[i+1], 1), JS); Exists(m, _p) {
|
return _p
|
||||||
return _p
|
} else {
|
||||||
}
|
return p
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return kit.ExtChange(p, JS)
|
|
||||||
}
|
}
|
||||||
func SplitPath(m *ice.Message, p string) []string {
|
func SplitPath(m *ice.Message, p string) []string {
|
||||||
if kit.HasPrefix(p, ice.REQUIRE_SRC, ice.REQUIRE_USR) {
|
if kit.HasPrefix(p, ice.REQUIRE_SRC, ice.REQUIRE_USR) {
|
||||||
|
@ -405,7 +405,8 @@ func init() {
|
|||||||
if p = path.Join(cache, path.Join(arg...)); !nfs.Exists(m, p) {
|
if p = path.Join(cache, path.Join(arg...)); !nfs.Exists(m, p) {
|
||||||
if p = path.Join(ice.USR_REQUIRE, path.Join(arg...)); !nfs.Exists(m, p) {
|
if p = path.Join(ice.USR_REQUIRE, path.Join(arg...)); !nfs.Exists(m, p) {
|
||||||
if m.Warn(kit.Lasterr(git.PlainClone(path.Join(ice.USR_REQUIRE, path.Join(arg[:3]...)), false, &git.CloneOptions{
|
if m.Warn(kit.Lasterr(git.PlainClone(path.Join(ice.USR_REQUIRE, path.Join(arg[:3]...)), false, &git.CloneOptions{
|
||||||
URL: ice.HTTPS + "://" + ls[0], Depth: 1, ReferenceName: plumbing.NewTagReferenceName(kit.Select(ice.Info.Gomod[ls[0]], ls, 1)),
|
URL: ice.HTTPS + "://" + path.Join(arg[0], arg[1], ls[0]), Depth: 1,
|
||||||
|
ReferenceName: plumbing.NewTagReferenceName(kit.Select(ice.Info.Gomod[ls[0]], ls, 1)),
|
||||||
}))) {
|
}))) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user