Fix: get execute file path dynamically
This commit is contained in:
@@ -31,7 +31,7 @@ V` + conf.BackendVersion + ` Commit #` + conf.LastCommit + ` Pro=` + conf.IsPr
|
||||
================================================
|
||||
|
||||
`)
|
||||
data, err := ioutil.ReadFile(string([]byte{107, 101, 121, 46, 98, 105, 110}))
|
||||
data, err := ioutil.ReadFile(util.RelativePath(string([]byte{107, 101, 121, 46, 98, 105, 110})))
|
||||
if err != nil {
|
||||
util.Log().Panic("%s", err)
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ func (b *GinFS) Exists(prefix string, filepath string) bool {
|
||||
func InitStatic() {
|
||||
var err error
|
||||
|
||||
if util.Exists("statics") {
|
||||
if util.Exists(util.RelativePath("statics")) {
|
||||
util.Log().Info("检测到 statics 目录存在,将使用此目录下的静态资源文件")
|
||||
StaticFS = static.LocalFile("statics", false)
|
||||
StaticFS = static.LocalFile(util.RelativePath("statics"), false)
|
||||
} else {
|
||||
StaticFS = &GinFS{}
|
||||
StaticFS.(*GinFS).FS, err = fs.New()
|
||||
|
||||
Reference in New Issue
Block a user