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

refactor(json): use default config file if the user config is empty #1546

Closed
wants to merge 2 commits into from

Conversation

nnyyxxxx
Copy link
Contributor

@nnyyxxxx nnyyxxxx commented Feb 8, 2025

if the user config is empty we get a failed to parse json error, instead of erroring out we should just show the default config since there is technically nothing wrong with the users config file if its empty :)

minor variable naming change as well for readability

potentially fixes a case where we could read twice instead of once

removes a redundant || false condition (habbit probs)

@CarterLi
Copy link
Member

CarterLi commented Feb 8, 2025

I don't like the change. You read config files twice unnecessarily. Meanwhile, I don't like your habbit.

there is technically nothing wrong with the users config file if its empty

An empty string is not a valid JSON string, same as "" != NULL. Just remove the file.

@CarterLi CarterLi closed this Feb 8, 2025
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.

2 participants