Skip to content

Commit 25b6eec

Browse files
authored
Merge pull request cli#4017 from despreston/des/avoid-migrate
Skip auto migrate of config when GH_CONFIG_DIR
2 parents 97a52f7 + 1c9b4bf commit 25b6eec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/config/config_file.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ func ConfigDir() string {
4040
path = filepath.Join(d, ".config", "gh")
4141
}
4242

43-
// If the path does not exist try migrating config from default paths
44-
if !dirExists(path) {
43+
// If the path does not exist and the GH_CONFIG_DIR flag is not set try
44+
// migrating config from default paths.
45+
if !dirExists(path) && os.Getenv(GH_CONFIG_DIR) == "" {
4546
_ = autoMigrateConfigDir(path)
4647
}
4748

0 commit comments

Comments
 (0)