IlanCosman / scuba

🤿 Minimal plugin manager for the friendly interactive shell
MIT License
18 stars 0 forks source link

Scuba reports unnecessary failure messages on missing uninstall.fish files #5

Closed mattmc3 closed 4 years ago

mattmc3 commented 4 years ago

Describe the bug

When installing a plugin, scuba tries to remove the uninstall.fish files, and when it can't, scuba reports that those optional files are missing. Not all plugins have uninstall.fish files.

Steps to reproduce

$ scuba install ilancosman/scuba
rm: /var/folders/b8/fk8n159x73q078cc1n2c_6jjd1t92m/T/tmp.hS8Z70JI/completions/uninstall.fish: No such file or directory
rm: /var/folders/b8/fk8n159x73q078cc1n2c_6jjd1t92m/T/tmp.hS8Z70JI/conf.d/uninstall.fish: No such file or directory
rm: /var/folders/b8/fk8n159x73q078cc1n2c_6jjd1t92m/T/tmp.hS8Z70JI/functions/uninstall.fish: No such file or directory

Expected behavior

Test for file existence on line 33 in _scuba_sub_install before trying to rm the file

Environment (please complete the following information)

fish, version 3.1.2
scuba, version 1.0.0
IlanCosman commented 4 years ago

I can't reproduce this on MacOS or Arch. rm -f shouldn't error even if the file doesn't exist. Maybe try reinstalling Scuba?

mattmc3 commented 4 years ago

Hmm, looks like I have rm wrapped in a safer script that handles -f slightly differently. Looking at the fisher code, it avoids this issue by explicitly using command rm rather than whatever rm the user has aliased or altered (https://github.com/jorgebucaran/fisher/blob/main/fisher.fish). Since I, and probably many others, aren't using unsafe rm as-is and are probably not willing to change, I wonder if you might be willing to prefix your calls to rm with command rm?

IlanCosman commented 4 years ago

Gahhh. I knew I would run into this eventually, I just didn't think it would be one of the first people using Scuba lol. Very well. I'll prefix everything in command 😢

mattmc3 commented 4 years ago

Thank you sir! You're a scholar and a gentleman. If it's any consolation, those of us who like to fiddle with our configs are probably gonna be first to try new things like scuba, but then are also probably the ones that have all kinds of fiddly configs 🤷. So far, I like what I see. It's always good to see new movement in the fish world.