-
Notifications
You must be signed in to change notification settings - Fork 248
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
Exception handling #207
Exception handling #207
Conversation
This commit covers: 1. Specifying the backup path to an existing filename. 2. KeyboardInterrupts at menus and prompts. 3. When backing up packages, failed but installed commands (e.g., ls xxx/.cargo/bin) outputted their error messages to STDOUT. 4. No need to clean up empty backup files now since we don't write to the packages' files if they're not installed. 5. Because of #4, we needed to move npm's 2nd write section into an if so that it wouldn't try to remove a nonexistent file.
I decided to exit here instead of reprompting like in path_update_prompt() because if you're using the --new_path option you decided not to just use the regular path update prompt for some reason. I don't really know why this option's a thing honestly because running shallow-backup with no arguments always prompts you to update the path anyways.
Also got rid of unnecessary inner function.
why was a 49.451% coverage acceptable but not 49.351 |
(On mobile, sorry for the potentially awful formatting.)
In summary, this looks awesome and I can't wait to get this merged in. I'll go through it when I'm home and see if there's anything we can improve. :) |
Sounds good! No rush though enjoy your vacation! 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, great improvements to the user experience.
Minor refactoring is needed to minimize code duplication. See other comments for further feedback.
I'll cut a new release as soon as we get this merged in.
Co-Authored-By: bl0nd <xorblonded@gmail.com>
No unfortunately :/ |
No big deal, testing exception handling isn't super critical. I also have no idea how to do this. I'm going to sit on this for a bit before I merge it to make sure I'm not missing anything, but I'm pretty confident it's all done. It's been a pleasure working with you on this. Thank you for the contribution. |
It's been a pleasure to work with you as well, thanks alot for the fun! |
So this PR is a fix for most things that I found which could be fixed without major refactoring, including:
--new_path
).ls xxx/.cargo/bin
when I didn't have cargo.configs_mapping
instead ofconfig_mapping
inreinstall_configs()
when accessing the config dict.I tried to follow your lead of allowing users to fix the issues themselves by reprompting and things like that but if you have any further suggestions I'll try my best to do them.
For some of the unfixed problems (critical and otherwise) like failing to reinstall configs for an already existing Sublime Text 3 because copytree() doesn't overwrite, I'll make a separate issue. The main reason for not fixing them in this PR was just because I didn't want to do major code revisions, I just wanted to focus on general handling in this one.