Skip to content

Commit 8dc6c9a

Browse files
feat: load the config file from the current working directory (#504)
Co-authored-by: Andrés Aguiar <[email protected]>
1 parent e0a2748 commit 8dc6c9a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cmd/root.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,12 @@ func initConfig() {
102102
homeDir, err := os.UserHomeDir()
103103
cobra.CheckErr(err)
104104

105-
// Search for .fga.yaml in:
106-
// 1- XDG_CONFIG/User Config Directory
107-
// 2- fga directory under User Config Directory
108-
// 3- Home directory
105+
// Search for .fga.yml or .fga.yaml in:
106+
// 1- The current working directory
107+
// 2- The user-specific config directory
108+
// 3- The fga subdirectory under the user-specific config directory
109+
// 4- The current user's home directory
110+
viperInstance.AddConfigPath(".")
109111
viperInstance.AddConfigPath(configDir)
110112
viperInstance.AddConfigPath(configDir + "/" + "fga")
111113
viperInstance.AddConfigPath(homeDir)

0 commit comments

Comments
 (0)