mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-18 05:02:56 +01:00
refactor: subcommands (#1111)
This commit is contained in:
33
app/flags.go
33
app/flags.go
@@ -6,7 +6,6 @@ import (
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/SecurityBrewery/catalyst/migrations"
|
||||
)
|
||||
@@ -85,35 +84,3 @@ func SetFlags(app core.App, args []string) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func setFeatureFlagsCmd(app core.App) *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "set-feature-flags",
|
||||
Run: func(_ *cobra.Command, args []string) {
|
||||
if err := SetFlags(app, args); err != nil {
|
||||
app.Logger().Error(err.Error())
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func setAppURL(app core.App) *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "set-app-url",
|
||||
Run: func(_ *cobra.Command, args []string) {
|
||||
if len(args) != 1 {
|
||||
app.Logger().Error("missing app url")
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
settings := app.Settings()
|
||||
|
||||
settings.Meta.AppUrl = args[0]
|
||||
|
||||
if err := app.Dao().SaveSettings(settings); err != nil {
|
||||
app.Logger().Error(err.Error())
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user