diff --git a/base/nfs/dir.go b/base/nfs/dir.go index cc2c54de..cfc7f0ec 100644 --- a/base/nfs/dir.go +++ b/base/nfs/dir.go @@ -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) { diff --git a/misc/git/repos.go b/misc/git/repos.go index 17296af1..54b2793d 100644 --- a/misc/git/repos.go +++ b/misc/git/repos.go @@ -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 }