MordechaiHadad / bob

A version manager for neovim
MIT License
1.41k stars 36 forks source link

[Feature] bob erase - do not delete non empty installation_location directory #211

Closed kisuryoza closed 3 months ago

kisuryoza commented 3 months ago

Currently bob erase erases directories associated with bob.

When in config user sets installation_location = /home/user/.local/bin in order to have nvim among with other user's binaries, he does not expect the whole bin directory to be erased.

I suggest that after bob erase, only nvim should be deleted if the directory it is in is not empty. Or ask the user for confirmation of deleting the whole directories.

MordechaiHadad commented 3 months ago

@kisuryoza created a new PR, could you test it and tell me if this is what u wanted?

kisuryoza commented 3 months ago

No but here's what I wanted #220. I tested it with default/custom installation paths and it works as I wanted.

MordechaiHadad commented 3 months ago

hmm let me understand one thing, why exactly would you prefer not deleting? bob creates bob-nvim sub directory under installation directory. and bob erase is supposed to erase everything bob related.

So why not erase the sub directory instead of not deleting it.

kisuryoza commented 3 months ago

For the default installation_location there are no problems. But if I set installation_location = /home/user/.local/bin in config.toml, bob use *** will put the executable inside /home/user/.local/bin among my other files as I want. And bob erase deletes the entire /home/user/.local/bin, what I didn't expect, loosing files I didn't want to.

If the current behavior is preferable it would be better to ask a user for confirmation of deleting the whole installation_location.

MordechaiHadad commented 3 months ago

AHHH okay, no worries. I will simply add what you wanted to my current PR.

MordechaiHadad commented 3 months ago

@kisuryoza better now?

kisuryoza commented 3 months ago

Yes. Though after the erase the executable is being left.

MordechaiHadad commented 3 months ago

@kisuryoza done

kisuryoza commented 3 months ago

Now it's all working as I requested.