mirror of
https://shylinux.com/x/icebergs
synced 2025-06-26 10:27:31 +08:00
opt some
This commit is contained in:
parent
91b13b4bfd
commit
8fd40a8fdb
@ -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)
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user