mirror of
https://github.com/quarkcloudio/quark-go.git
synced 2025-09-27 04:15:54 +08:00
fix: 优化安装代码
This commit is contained in:
@@ -46,7 +46,7 @@ func main() {
|
||||
b.Static("/", "./website")
|
||||
|
||||
// 自动构建数据库、拉取静态文件
|
||||
b.Use(install.Handle)
|
||||
install.Handle()
|
||||
|
||||
// 后台中间件
|
||||
b.Use(middleware.Handle)
|
||||
|
@@ -55,7 +55,7 @@ func main() {
|
||||
b := builder.New(config)
|
||||
|
||||
// 初始化安装
|
||||
b.Use(install.Handle)
|
||||
install.Handle()
|
||||
|
||||
// 中间件
|
||||
b.Use(middleware.Handle)
|
||||
|
@@ -35,7 +35,7 @@ func main() {
|
||||
b := builder.New(config)
|
||||
|
||||
// 初始化安装
|
||||
b.Use(install.Handle)
|
||||
install.Handle()
|
||||
|
||||
// 中间件
|
||||
b.Use(middleware.Handle)
|
||||
|
@@ -44,7 +44,7 @@ func main() {
|
||||
b := builder.New(config)
|
||||
|
||||
// 初始化安装
|
||||
b.Use(install.Handle)
|
||||
install.Handle()
|
||||
|
||||
// 中间件
|
||||
b.Use(middleware.Handle)
|
||||
|
@@ -30,7 +30,7 @@ func main() {
|
||||
b.Static("/", "./website")
|
||||
|
||||
// 自动构建数据库、拉取静态文件
|
||||
b.Use(install.Handle)
|
||||
install.Handle()
|
||||
|
||||
// 后台中间件
|
||||
b.Use(middleware.Handle)
|
||||
|
@@ -4,7 +4,6 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/quarkcms/quark-go/pkg/app/model"
|
||||
"github.com/quarkcms/quark-go/pkg/builder"
|
||||
"github.com/quarkcms/quark-go/pkg/dal/db"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@@ -23,11 +22,11 @@ func PathExist(path string) bool {
|
||||
}
|
||||
|
||||
// 执行安装操作
|
||||
func Handle(ctx *builder.Context) error {
|
||||
func Handle() {
|
||||
|
||||
// 如果锁定文件存在则不执行安装步骤
|
||||
if PathExist("install.lock") {
|
||||
return ctx.Next()
|
||||
return
|
||||
}
|
||||
|
||||
// 迁移数据
|
||||
@@ -62,6 +61,4 @@ func Handle(ctx *builder.Context) error {
|
||||
// 创建锁定文件
|
||||
file, _ := os.Create("install.lock")
|
||||
file.Close()
|
||||
|
||||
return ctx.Next()
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ const (
|
||||
AppName = "QuarkGo"
|
||||
|
||||
// Version of current package
|
||||
Version = "1.1.11"
|
||||
Version = "1.1.12"
|
||||
|
||||
// 静态文件URL
|
||||
RespositoryURL = "https://github.com/quarkcms/quark-go/tree/main/website/"
|
||||
|
Reference in New Issue
Block a user