1
0
mirror of https://shylinux.com/x/icebergs synced 2025-06-26 18:37:29 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-05-23 12:05:52 +08:00
parent 91b13b4bfd
commit 8fd40a8fdb
2 changed files with 7 additions and 7 deletions

View File

@ -10,6 +10,7 @@ import (
"shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/nfs" "shylinux.com/x/icebergs/base/nfs"
kit "shylinux.com/x/toolkits" kit "shylinux.com/x/toolkits"
"shylinux.com/x/toolkits/logs"
) )
func _command_list(m *ice.Message, name string) *ice.Message { 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 IsOrderCmd(key string) bool { return key[0] == '/' || key[0] == '_' }
func FileURI(dir string) string { func FileURI(dir string) string {
logs.Println("%v %v %v", dir, ice.Info.Make.Path, kit.Path(""))
if dir == "" { if dir == "" {
return "" return ""
} else if strings.Contains(dir, "/pkg/mod/") { } else if strings.Contains(dir, "/pkg/mod/") {
dir = strings.Split(dir, "/pkg/mod/")[1] dir = strings.Split(dir, "/pkg/mod/")[1]
} else if path.IsAbs(dir) { } 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) 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)) { } else if nfs.Exists(ice.Pulse, path.Join(ice.SRC, dir)) {
dir = path.Join(ice.SRC, dir) dir = path.Join(ice.SRC, dir)

View File

@ -346,7 +346,7 @@ func init() {
m.RenderStatusBadRequest() m.RenderStatusBadRequest()
} else if path.Join(arg[:3]...) == ice.Info.Make.Module && nfs.Exists(m, path.Join(arg[3:]...)) { } else if path.Join(arg[:3]...) == ice.Info.Make.Module && nfs.Exists(m, path.Join(arg[3:]...)) {
m.RenderDownload(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) m.RenderDownload(p)
} else { } else {
p := path.Join(kit.GetValid( p := path.Join(kit.GetValid(
@ -354,9 +354,7 @@ func init() {
func() string { func() string {
return kit.Select(kit.HomePath("go")+nfs.PS, m.Cmdx(cli.SYSTEM, "go", "env", "GOPATH")) + "/pkg/mod/" return kit.Select(kit.HomePath("go")+nfs.PS, m.Cmdx(cli.SYSTEM, "go", "env", "GOPATH")) + "/pkg/mod/"
}, },
func() string { func() string { return ice.USR_REQUIRE },
return ice.USR_REQUIRE
},
), path.Join(arg...)) ), path.Join(arg...))
if !nfs.Exists(m, p) { if !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) {