Feat: eject internal static files

This commit is contained in:
HFO4
2020-05-23 13:57:02 +08:00
parent 60745ac8ba
commit ee0f8e964d
3 changed files with 79 additions and 3 deletions

12
main.go
View File

@@ -8,15 +8,25 @@ import (
"github.com/HFO4/cloudreve/routers"
)
var confPath string
var (
isEject bool
confPath string
)
func init() {
flag.StringVar(&confPath, "c", util.RelativePath("conf.ini"), "配置文件路径")
flag.BoolVar(&isEject, "eject", false, "导出内置静态资源")
flag.Parse()
bootstrap.Init(confPath)
}
func main() {
if isEject {
// 开始导出内置静态资源文件
bootstrap.Eject()
return
}
api := routers.InitRouter()
// 如果启用了SSL