mirror of
https://github.com/cloudreve/cloudreve.git
synced 2025-10-28 11:04:47 +08:00
Fix: embed static file not work (introduced in #1107)
embed file system should be declared in main pkg
This commit is contained in:
6
main.go
6
main.go
@ -17,20 +17,20 @@ var (
|
||||
)
|
||||
|
||||
//go:embed assets/build
|
||||
var StaticEmbed embed.FS
|
||||
var staticEmbed embed.FS
|
||||
|
||||
func init() {
|
||||
flag.StringVar(&confPath, "c", util.RelativePath("conf.ini"), "配置文件路径")
|
||||
flag.BoolVar(&isEject, "eject", false, "导出内置静态资源")
|
||||
flag.StringVar(&scriptName, "database-script", "", "运行内置数据库助手脚本")
|
||||
flag.Parse()
|
||||
bootstrap.Init(confPath)
|
||||
bootstrap.Init(confPath, staticEmbed)
|
||||
}
|
||||
|
||||
func main() {
|
||||
if isEject {
|
||||
// 开始导出内置静态资源文件
|
||||
bootstrap.Eject()
|
||||
bootstrap.Eject(staticEmbed)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user