anishathalye / dotbot

A tool that bootstraps your dotfiles ⚡️
MIT License
6.91k stars 288 forks source link

When linking to exisinting files using glob option, only the portion matching the glob is used for names #279

Closed the-shank closed 3 years ago

the-shank commented 3 years ago

Consider that I have the below files

image

I wish to symlink these to ~/.local/bin directory.

When I use:

~/.local/bin:
  path: scripts/display_*
  glob: true

The created symlinks are named single.sh and multiple.sh instead of display_single.sh and display_multiple.sh. Is this the intended behaviour? If so, is there a way to use use globs and still get the symlinks with the complete filename?

eengstrom commented 3 years ago

I noted the same behavior while implementing a seemingly unrelated feature (see #259 - adding link prefixes), and I fixed it. It's in a PR (#272), but @anishathalye is waiting to merge that until I fix another issue that is related (PR #271 - adding recursive globs). I've been slow in getting to that, but I might have time soon.

Bottom line, this is a known bad behavior, and soon to be fixed.

eengstrom commented 3 years ago

Actually, ignore that comment. The fix I made was in PR #268, but it's incomplete and doesn't address your test case. I have a solution in mind that should fix it and it should be fast. Will see what I can do - I'm bored today anyway ;-)

the-shank commented 3 years ago

Thank you @eengstrom !

eengstrom commented 3 years ago

so, @the-shank - what version of dotbot are you using? (use dotbot --version).

I ask because while I thought I saw a potential bug in my code that would have created the symptoms you were seeing, I can't reproduce, and I think you might be on a version before my changes were merged.

the-shank commented 3 years ago

@eengstrom I can confirm that this issue does not happen with the latest version. Thank you for your help and I apologize for wasting your time.