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

fix: parsing glob strings #404

Merged
merged 2 commits into from
Oct 28, 2019
Merged

fix: parsing glob strings #404

merged 2 commits into from
Oct 28, 2019

Conversation

wwilsman
Copy link
Contributor

@wwilsman wwilsman commented Oct 28, 2019

Purpose

When passing a comma-separated list of globs, sometimes spaces might appear after commas causing the globs to start or end with a space.

I also noticed that valid globs with comma separated lists (commonly used for extensions) would be split incorrectly. i.e. **/*.{html,htm} and **/*.{png,jpg,jpeg}

Fixes #311

Approach

Created a common parseGlobs configuration utility that splits a comma-separated string, while preserving glob lists within {...}, and trims whitespace from glob patterns. It also performs the duty of filtering out empty strings.

The configuration unit tests were nested so this could be tested without the extra hooks used in the other config tests.

@Robdel12
Copy link
Contributor

🏁 I manually finalized the Percy build

Copy link
Contributor

@Robdel12 Robdel12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏁

@wwilsman wwilsman merged commit d52e552 into master Oct 28, 2019
@wwilsman wwilsman deleted the ww/parse-globs branch October 28, 2019 22:18
djones pushed a commit that referenced this pull request Oct 28, 2019
## [0.19.3](v0.19.2...v0.19.3) (2019-10-28)

### Bug Fixes

* parsing glob strings ([#404](#404)) ([d52e552](d52e552))
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.

[Static site] Automatically strip spaces after commas
2 participants