[server][cmd] clean up debug flag

This commit is contained in:
Abhishek Shroff
2024-10-17 22:54:06 +05:30
parent 7e00039ab3
commit 8096520e62
4 changed files with 11 additions and 15 deletions

View File

@@ -12,8 +12,6 @@ import (
"github.com/spf13/viper"
)
var debug bool = false
func SetupCommand() {
viper.SetEnvPrefix("phylum")
@@ -39,7 +37,7 @@ func SetupCommand() {
os.Mkdir(workDir, 0750)
os.Chdir(workDir)
}
debug = viper.GetBool("debug")
debug := viper.GetBool("debug")
if debug {
logrus.Info("Running in debug mode")
logrus.SetLevel(logrus.TraceLevel)
@@ -59,7 +57,7 @@ func SetupCommand() {
}()
rootCmd.AddCommand([]*cobra.Command{
appcmd.SetupCommand(debug),
appcmd.SetupCommand(),
setupSchemaCommand(),
}...)
rootCmd.Execute()