You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
[WIP] add viper to manage envvars and cfg files
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/asdine/storm"
|
||||
"github.com/filebrowser/filebrowser/v2/settings"
|
||||
"github.com/spf13/cobra"
|
||||
v "github.com/spf13/viper"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -28,6 +29,7 @@ to the defaults when creating new users and you don't
|
||||
override the options.`,
|
||||
Args: cobra.NoArgs,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
databasePath := v.GetString("database")
|
||||
if _, err := os.Stat(databasePath); err == nil {
|
||||
panic(errors.New(databasePath + " already exists"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user