Fix handling for non-existent or empty config files #61

Merged
JakeGuy11 merged 54 commits from master into master 2021-08-12 16:30:13 +00:00
JakeGuy11 commented 2021-05-05 03:03:40 +00:00 (Migrated from github.com)

I recently noticed that if I manually remove the contents of token.yml but keep the file, the program throws an error. A little playing around and I found that the same things happen with entries in other config files.

These changes fix the handling for that. Instead of throwing errors, it will warn the user that their entries are invalid and manually set them to the default.

I considering a few other things in place of hard coding in the default config values (in case they ever change), but in the end, I decided not to. My main alternative would have been to have default cli-defaults.yml, bin-path.yml and dir-path.yml files somewhere else that it would pull from instead. If the maintainers think that's a better idea, let me know and I can do that.

I recently noticed that if I manually remove the contents of `token.yml` but keep the file, the program throws an error. A little playing around and I found that the same things happen with entries in other config files. These changes fix the handling for that. Instead of throwing errors, it will warn the user that their entries are invalid and manually set them to the default. I considering a few other things in place of hard coding in the default config values (in case they ever change), but in the end, I decided not to. My main alternative would have been to have default `cli-defaults.yml`, `bin-path.yml` and `dir-path.yml` files somewhere else that it would pull from instead. If the maintainers think that's a better idea, let me know and I can do that.
Sign in to join this conversation.
No description provided.