mirror of
https://codeberg.org/shroff/phylum.git
synced 2026-01-02 01:29:42 -06:00
Remove app admin command
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
package admincmd
|
||||
|
||||
import (
|
||||
"github.com/shroff/phylum/server/internal/storage"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func SetupCommand(cs storage.Storage) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "admin",
|
||||
Short: "Server Administration",
|
||||
}
|
||||
cmd.AddCommand([]*cobra.Command{
|
||||
setupStorageCommand(cs),
|
||||
setupUserCommand(),
|
||||
}...)
|
||||
|
||||
return cmd
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package appcmd
|
||||
|
||||
import (
|
||||
"github.com/shroff/phylum/server/internal/app"
|
||||
"github.com/shroff/phylum/server/internal/command/appcmd/admincmd"
|
||||
"github.com/shroff/phylum/server/internal/db"
|
||||
"github.com/shroff/phylum/server/internal/storage"
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -42,9 +41,10 @@ func SetupCommand(db **db.DbHandler, debug bool) *cobra.Command {
|
||||
viper.BindPFlag("content_dir", flags.Lookup("content-dir"))
|
||||
|
||||
cmd.AddCommand([]*cobra.Command{
|
||||
admincmd.SetupCommand(cs),
|
||||
setupServeCommand(),
|
||||
setupUserCommand(),
|
||||
setupResourceCommand(),
|
||||
setupStorageCommand(cs),
|
||||
}...)
|
||||
|
||||
return cmd
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package admincmd
|
||||
package appcmd
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
@@ -1,4 +1,4 @@
|
||||
package admincmd
|
||||
package appcmd
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -52,8 +52,10 @@ func SetupCommand() {
|
||||
}
|
||||
|
||||
defer func() {
|
||||
logrus.Info("Shutting Down App")
|
||||
database.Close()
|
||||
if database != nil {
|
||||
logrus.Info("Shutting Down App")
|
||||
database.Close()
|
||||
}
|
||||
}()
|
||||
|
||||
rootCmd.AddCommand([]*cobra.Command{
|
||||
|
||||
Reference in New Issue
Block a user