Skip auto migrate of config when GH_CONFIG_DIR
If GH_CONFIG_DIR is set, don't auto migrate the config file. This fixes the situation where the path given via GH_CONFIG_DIR does not exist and the cli attempts to migrate an existing config to that location. Fixes #3837
This commit is contained in:
parent
161de77fd7
commit
1c9b4bf99d
1 changed files with 3 additions and 2 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue