dotbot
dotbot copied to clipboard
Add the possibility of specifying more than one source path ...
… in which case the destination is assumed to be a folder in which source paths are linked.
This is to solve #301. The diff on github is borked and shows lots of changes, but the changes are actually quite small:
-
Link._default_sources
was changed to return a list of sources rather than a single source -
path
is changed topaths
and all of the linking action is wrapped in an additional loop that iterates over source paths - If globbing is active, additional tests are added for edge cases
- If there is no globbing and several paths are given, the destination path is assumed to be a directory, so we adapt the destination path accordingly
If you're ok with the approach I'll also edit the documentation. I don't really understand how the tests work, but I'll also try to add a few test cases when I have time to look more into it.
Thanks for the PR! I haven't taken a close look at the diff/code yet, but my high level understanding is that this seems to be useful functionality that is backwards-compatible.
I'll take a closer look in a couple days.
If it's effort to get the tests running locally, don't worry about it, I can add a test based on your example in https://github.com/anishathalye/dotbot/issues/300#issuecomment-1059172312.
Hey, I haven't had time to work more on this and I'm handing in my master's thesis soon so won't have time to look at it for a while more --- if you want to proceed with adding a couple of tests and closing this issue, please don't wait on me :-)