Merge pull request #4017 from despreston/des/avoid-migrate

Skip auto migrate of config when GH_CONFIG_DIR
This commit is contained in:
Mislav Marohnić 2021-07-20 13:33:16 +02:00 committed by GitHub
commit 25b6eecc8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,8 +40,9 @@ func ConfigDir() string {
path = filepath.Join(d, ".config", "gh")
}
// If the path does not exist try migrating config from default paths
if !dirExists(path) {
// If the path does not exist and the GH_CONFIG_DIR flag is not set try
// migrating config from default paths.
if !dirExists(path) && os.Getenv(GH_CONFIG_DIR) == "" {
_ = autoMigrateConfigDir(path)
}