mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
use go:embed for static resources (#1107)
* feat: use go:embed to embed static files * ci: fix broken test * docs: update readme.md * chore: remove statik * feat: simplify code Co-authored-by: AaronLiu <abslant@126.com>
This commit is contained in:
4
main.go
4
main.go
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"flag"
|
||||
|
||||
"github.com/cloudreve/Cloudreve/v3/bootstrap"
|
||||
@@ -15,6 +16,9 @@ var (
|
||||
scriptName string
|
||||
)
|
||||
|
||||
//go:embed assets/build
|
||||
var StaticEmbed embed.FS
|
||||
|
||||
func init() {
|
||||
flag.StringVar(&confPath, "c", util.RelativePath("conf.ini"), "配置文件路径")
|
||||
flag.BoolVar(&isEject, "eject", false, "导出内置静态资源")
|
||||
|
||||
Reference in New Issue
Block a user