change hub file structure

This commit is contained in:
TOomaAh
2024-08-07 23:59:02 +02:00
parent 8a04a9bed6
commit d840178cc0
107 changed files with 5025 additions and 550 deletions

33
cmd/hub/hub.go Normal file
View File

@@ -0,0 +1,33 @@
package main
import (
"beszel"
"beszel/internal/hub"
"beszel/internal/update"
"github.com/pocketbase/pocketbase"
"github.com/spf13/cobra"
)
func main() {
var app *pocketbase.PocketBase
app = pocketbase.NewWithConfig(pocketbase.Config{
DefaultDataDir: beszel.AppName + "_data",
})
app.RootCmd.Version = beszel.Version
app.RootCmd.Use = beszel.AppName
app.RootCmd.Short = ""
// add update command
app.RootCmd.AddCommand(&cobra.Command{
Use: "update",
Short: "Update " + beszel.AppName + " to the latest version",
Run: update.UpdateBeszel,
})
hubApp := hub.NewHub(app)
hubApp.Run()
}