Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Globbing with single file in source directory fails #315

Closed
DivineDominion opened this issue May 27, 2022 · 2 comments
Closed

Globbing with single file in source directory fails #315

DivineDominion opened this issue May 27, 2022 · 2 comments

Comments

@DivineDominion
Copy link

Running d2f76a2, I found that this from the examples:

link:
    ~/.config/:
        glob: true
        path: config/*

... does not work when you only have one file in the config directory.

Example:

$ cd ~/.dotfiles
$ mkdir config
$ touch config/test.ini
$ ./install
...
Ambiguous action requested.
No wildcard in glob, directory use undefined: ~/.config/ -> ['config/test.ini']
Did you want to link the directory or into it?
...

As soon as you add another file, globbing works.

@niraami
Copy link

niraami commented Jul 5, 2022

Duplicate of #282, but yes, it's absolutely time to fix this @anishathalye ... I've expressed my opinion in the other issue.
As a side note, this issue (#284) is very similar. People just expect glob to well.. be flexible.

anishathalye added a commit that referenced this issue Jul 9, 2023
See #282 and
#315.

This patch simplifies the implementation, removing special-case handling
for the cases of zero matches and one match. Instead, any situation
where `glob: true` is specified and the path contains a glob character
(any of "?", "*", or "[") is treated as a glob case. The reason we check
both `use_glob` and `_has_glob_chars()` is to more gracefully handle the
case where the user has enabled globs by default, but most links do not
contain glob characters and should not be treated as globs.
@anishathalye
Copy link
Owner

Thanks for bumping this. Dupe of #282, now fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants