You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
feat: wrap commands to send info (#612)
Wrap commands in a better way to pass storage
This commit is contained in:
@@ -13,14 +13,11 @@ var configCatCmd = &cobra.Command{
|
||||
Short: "Prints the configuration",
|
||||
Long: `Prints the configuration.`,
|
||||
Args: cobra.NoArgs,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
db := getDB()
|
||||
defer db.Close()
|
||||
st := getStorage(db)
|
||||
s, err := st.Settings.Get()
|
||||
Run: python(func(cmd *cobra.Command, args []string, d pythonData) {
|
||||
s, err := d.store.Settings.Get()
|
||||
checkErr(err)
|
||||
auther, err := st.Auth.Get(s.AuthMethod)
|
||||
auther, err := d.store.Auth.Get(s.AuthMethod)
|
||||
checkErr(err)
|
||||
printSettings(s, auther)
|
||||
},
|
||||
}, pythonConfig{}),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user