dotbot icon indicating copy to clipboard operation
dotbot copied to clipboard

Add the possibility of specifying more than one source path ...

Open ldorigo opened this issue 2 years ago • 2 comments

… 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 to paths 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.

ldorigo avatar Mar 04 '22 15:03 ldorigo

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.

anishathalye avatar Mar 06 '22 11:03 anishathalye

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 :-)

ldorigo avatar Jun 04 '22 10:06 ldorigo