Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When saving to an aggregate config, use fallback locations #52

Merged
merged 3 commits into from
Apr 26, 2021
Merged

Conversation

kzu
Copy link
Collaborator

@kzu kzu commented Apr 26, 2021

We were previously assuming that there would always be a default config file (plain .netconfig in a non-system/global location) in the aggregate. This was problematic if you had opened a CLI app from the user's profile dir, which is even the default when running cmd, for example), since in that case there would be no default .netconfig, only the global config as the first entry.

So we instead use a smarter probing with fallbacks in place so that we try:

  1. Default config if any found
  2. Non-local (.user) file next
  3. Local (.user) file if none found.

Fixes #51

We were previously assuming that there would always be a default config file (plain .netconfig in a non-system/global location) in the aggregate. This was problematic if you had opened a CLI app from the user's profile dir, which is even the default when running cmd, for example), since in that case there would be no default .netconfig, only the global config as the first entry.

So we instead use a smarter probing with fallbacks in place so that we try:

1. Default config if any found
2. Non-local (.user) file next
3. Local (.user) file if none found.

Fixes #51
@kzu kzu enabled auto-merge (rebase) April 26, 2021 14:48
@kzu kzu merged commit dd73996 into main Apr 26, 2021
@kzu kzu deleted the fix-51 branch April 26, 2021 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fails to save variables in global dir
1 participant