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

Add slash to search pattern if missing #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Birne94
Copy link

@Birne94 Birne94 commented Oct 24, 2019

When specifying an image directory without a trailing slash, the search pattern won't pick up images in subdirectories because a wrong pattern is generated (e.g. /images**/*.* vs /images/**/*.*).

If a slash is missing, it is now appended before building the search pattern.

This should also fix #6

@sverrirs
Copy link
Owner

Hi Daniel @Birne94 thank you for taking the time to submit the two PRs. The help is much appreciated :) There is a slight conflict with this change which I was wondering if you'd be willing to resolve so that I can merge?

@Birne94
Copy link
Author

Birne94 commented Oct 29, 2019

I have resolved the conflict, but I think this introduces some inconsistent behavior now. When the new nested option is set to false and the image directory ends with a slash, nested images are still included. When this PR is merged, the nested flag will become irrelevant since nested images are always getting included.

You should decide if nested searching should be always enabled (then a slash should be appended as in this PR) or configurable by the user (then the glob pattern should change from /**/*.* to /*.* if disabled).

@sverrirs
Copy link
Owner

Good point, I will investigate this further

@BerkhanEminsoy
Copy link

BerkhanEminsoy commented Dec 1, 2021

any leads on this one? I get 0 file(s) generated with img_dir w/o an appended slash and a build error w/ an appended slash. See repo. When I append a slash I get an invalid argument @ ..assets/img/C: somehow

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

Successfully merging this pull request may close these issues.

None yet

3 participants