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 {
|
||||
p = kit.TrimPrefix(p, kit.Path("")+PS)
|
||||
for i := 0; i < len(bind); i += 2 {
|
||||
if strings.HasPrefix(p, bind[i]) {
|
||||
if _p := kit.ExtChange(strings.Replace(p, bind[i], bind[i+1], 1), JS); Exists(m, _p) {
|
||||
return _p
|
||||
}
|
||||
}
|
||||
if _p := kit.ExtChange(p, JS); Exists(m, _p) {
|
||||
return _p
|
||||
} else if _p := kit.ExtChange(path.Join(ice.USR_VOLCANOS, "plugin/local", path.Join(kit.Slice(kit.Split(p, "/"), -2)...)), JS); Exists(m, _p) {
|
||||
return _p
|
||||
} else {
|
||||
return p
|
||||
}
|
||||
return kit.ExtChange(p, JS)
|
||||
}
|
||||
func SplitPath(m *ice.Message, p string) []string {
|
||||
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(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{
|
||||
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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user