diff --git a/base/ctx/command.go b/base/ctx/command.go index 67b7cd1a..cbe2d01c 100644 --- a/base/ctx/command.go +++ b/base/ctx/command.go @@ -10,6 +10,7 @@ import ( "shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/nfs" kit "shylinux.com/x/toolkits" + "shylinux.com/x/toolkits/logs" ) func _command_list(m *ice.Message, name string) *ice.Message { @@ -120,15 +121,16 @@ func CmdList(m *ice.Message) *ice.Message { func IsOrderCmd(key string) bool { return key[0] == '/' || key[0] == '_' } func FileURI(dir string) string { + logs.Println("%v %v %v", dir, ice.Info.Make.Path, kit.Path("")) if dir == "" { return "" } else if strings.Contains(dir, "/pkg/mod/") { dir = strings.Split(dir, "/pkg/mod/")[1] } else if path.IsAbs(dir) { - if strings.HasPrefix(dir, kit.Path("")+nfs.PS) { + if ice.Info.Make.Path != "" && strings.HasPrefix(dir, ice.Info.Make.Path) { + dir = strings.TrimPrefix(dir, ice.Info.Make.Path) + } else if strings.HasPrefix(dir, kit.Path("")+nfs.PS) { dir = strings.TrimPrefix(dir, kit.Path("")+nfs.PS) - } else if ice.Info.Make.Path != "" && strings.HasPrefix(dir, ice.Info.Make.Path+nfs.PS) { - dir = strings.TrimPrefix(dir, ice.Info.Make.Path+nfs.PS) } } else if nfs.Exists(ice.Pulse, path.Join(ice.SRC, dir)) { dir = path.Join(ice.SRC, dir) diff --git a/misc/git/repos.go b/misc/git/repos.go index f5b7b8d2..46482db4 100644 --- a/misc/git/repos.go +++ b/misc/git/repos.go @@ -346,7 +346,7 @@ func init() { m.RenderStatusBadRequest() } else if path.Join(arg[:3]...) == ice.Info.Make.Module && nfs.Exists(m, path.Join(arg[3:]...)) { m.RenderDownload(path.Join(arg[3:]...)) - } else if p := path.Join(kit.Split(arg[2], mdb.AT)[0], path.Join(arg[3:]...)); nfs.Exists(m, p) { + } else if p := path.Join(nfs.USR, kit.Split(arg[2], mdb.AT)[0], path.Join(arg[3:]...)); nfs.Exists(m, p) { m.RenderDownload(p) } else { p := path.Join(kit.GetValid( @@ -354,9 +354,7 @@ func init() { func() string { return kit.Select(kit.HomePath("go")+nfs.PS, m.Cmdx(cli.SYSTEM, "go", "env", "GOPATH")) + "/pkg/mod/" }, - func() string { - return ice.USR_REQUIRE - }, + func() string { return ice.USR_REQUIRE }, ), path.Join(arg...)) if !nfs.Exists(m, p) { if p = path.Join(ice.USR_REQUIRE, path.Join(arg...)); !nfs.Exists(m, p) {