Skip to content

Commit e05ac61

Browse files
committed
Change position of loading app config method
1 parent 59e2582 commit e05ac61

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

cmd/mpcium/main.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ func runNode(ctx context.Context, c *cli.Command) error {
123123

124124
viper.SetDefault("backup_enabled", true)
125125
config.InitViperConfig(configPath)
126-
127-
appConfig := config.LoadConfig()
128-
environment := appConfig.Environment
126+
environment := viper.GetString("environment")
129127
logger.Init(environment, debug)
130128

131129
// Print ASCII banner
@@ -140,10 +138,10 @@ func runNode(ctx context.Context, c *cli.Command) error {
140138
// Handle configuration based on prompt flag
141139
if usePrompts {
142140
promptForSensitiveCredentials()
143-
} else {
144-
// Validate the config values
145-
checkRequiredConfigValues(appConfig)
146141
}
142+
appConfig := config.LoadConfig()
143+
// Validate the config values
144+
checkRequiredConfigValues(appConfig)
147145

148146
consulClient := infra.GetConsulClient(environment)
149147
keyinfoStore := keyinfo.NewStore(consulClient.KV())

0 commit comments

Comments
 (0)