oknozor / toml-bombadil

A dotfile manager with templating
MIT License
221 stars 24 forks source link

Validate paths before clearing dotfiles #261

Open StandingPadAnimations opened 1 year ago

StandingPadAnimations commented 1 year ago

Is your feature request related to a problem? Please describe. When trying this out today, it ended up deleting my dotfiles without making sym links (due to invalid paths that the tool only realized after deleting the dot files). I thankfully have a backup, but it was painful to restore and shouldn't be needed.

Describe the solution you'd like Validate the final dotfile paths before deleting

Describe alternatives you've considered There are none, I didn't even know this tool would delete dotfiles without validation

Additional context This occurred while following the quick start guide

HarlemSquirrel commented 8 months ago

Yeah I see with the latest release 3.1.0 that my dotfiles are in a subdirectory are getting a "Path does not exist" and bombadil is playing tricks and deleting them from my repo directory. Good thing I have the git history!

shaleh commented 7 months ago

Can either of you provide a minimal example of bombadil not behaving as you expect? Something like "with this entry in the toml file and these files in the filesystem running link fails in this way". For instance @StandingPadAnimations did you have a typo or similar mistake in your toml file? Or were the files in your repo not in the paths the config expected?

StandingPadAnimations commented 7 months ago

It's been a good while, but I do remember there not being typos in the path, rather the paths being wrong in general (if I recall correctly, I was confused by what the docs stated at the time regarding source vs target dirs)

HarlemSquirrel commented 7 months ago

Well here's my current config that works fine with the latest main build but when using the last tagged release it deletes anything nested like config/alacritty

https://github.com/HarlemSquirrel/Dotfiles/blob/master/bombadil.toml