Skip to content

Commit

Permalink
Merge pull request #7 from stackitcloud/hs/config-consts-private
Browse files Browse the repository at this point in the history
Make config file consts private
  • Loading branch information
hcsa73 authored Nov 21, 2023
2 parents f19145c + 666a2d6 commit 3fa0bb8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ const (
)

const (
ConfigFolder = ".stackit"
ConfigFileName = "cli-config"
ConfigFileExtension = "json"
configFolder = ".stackit"
configFileName = "cli-config"
configFileExtension = "json"
)

func InitConfig() {
home, err := os.UserHomeDir()
cobra.CheckErr(err)
configFolderPath := filepath.Join(home, ConfigFolder)
configFilePath := filepath.Join(configFolderPath, fmt.Sprintf("%s.%s", ConfigFileName, ConfigFileExtension))
configFolderPath := filepath.Join(home, configFolder)
configFilePath := filepath.Join(configFolderPath, fmt.Sprintf("%s.%s", configFileName, configFileExtension))

viper.SetConfigName(ConfigFileName)
viper.SetConfigType(ConfigFileExtension)
viper.SetConfigName(configFileName)
viper.SetConfigType(configFileExtension)
viper.AddConfigPath(configFolderPath)

err = createFolderIfNotExists(configFolderPath)
Expand Down

0 comments on commit 3fa0bb8

Please sign in to comment.