forked from x/icebergs
opt some
This commit is contained in:
parent
9ab2d4b8cf
commit
09a602e14b
@ -54,7 +54,13 @@ func Script(m *ice.Message, name string) io.Reader {
|
||||
}
|
||||
m.Option("_script", name)
|
||||
|
||||
if s, e := os.Open(path.Join(m.Option(nfs.DIR_ROOT), name)); e == nil {
|
||||
back := kit.Split(m.Option(nfs.DIR_ROOT))
|
||||
for i := len(back) - 1; i >= 0; i-- {
|
||||
if s, e := os.Open(path.Join(path.Join(back[:i]...), name)); e == nil {
|
||||
return s
|
||||
}
|
||||
}
|
||||
if s, e := os.Open(name); e == nil {
|
||||
return s
|
||||
}
|
||||
|
||||
|
4
go.mod
4
go.mod
@ -6,9 +6,9 @@ require (
|
||||
github.com/Baozisoftware/qrcode-terminal-go v0.0.0-20170407111555-c0650d8dff0f
|
||||
github.com/gorilla/websocket v1.4.2
|
||||
github.com/kr/pty v1.1.1
|
||||
github.com/mattn/go-colorable v0.1.8 // indirect
|
||||
github.com/mattn/go-colorable v0.1.8
|
||||
github.com/nareix/joy4 v0.0.0-20200507095837-05a4ffbb5369
|
||||
github.com/shylinux/toolkits v0.2.0
|
||||
github.com/shylinux/toolkits v0.2.1
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
|
||||
github.com/tuotoo/qrcode v0.0.0-20190222102259-ac9c44189bf2
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550
|
||||
|
2
go.sum
2
go.sum
@ -12,6 +12,8 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky
|
||||
github.com/nareix/joy4 v0.0.0-20200507095837-05a4ffbb5369/go.mod h1:aFJ1ZwLjvHN4yEzE5Bkz8rD8/d8Vlj3UIuvz2yfET7I=
|
||||
github.com/shylinux/toolkits v0.2.0 h1:ZMJGFqqgZBXxu2jUw2Zqu8Vx8KhEgWcMBnlH3cR+MPQ=
|
||||
github.com/shylinux/toolkits v0.2.0/go.mod h1:Y68Ot6xOmo1bun67YvqC3chDGeU2gDxtsUnvVDGJm4g=
|
||||
github.com/shylinux/toolkits v0.2.1 h1:FNCL4Tz6KRHjJbJFGswRLAROzo/AJavW+MrcIOEuB34=
|
||||
github.com/shylinux/toolkits v0.2.1/go.mod h1:Y68Ot6xOmo1bun67YvqC3chDGeU2gDxtsUnvVDGJm4g=
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
|
||||
github.com/tuotoo/qrcode v0.0.0-20190222102259-ac9c44189bf2/go.mod h1:lPnW9HVS0vJdeYyQtOvIvlXgZPNhUAhwz+z5r8AJk0Y=
|
||||
|
Loading…
x
Reference in New Issue
Block a user