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

Support multiple extensions on --file-ext #1026

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from

Conversation

yumin-chen
Copy link

@yumin-chen yumin-chen commented May 14, 2019

This pull request adds support for multiple extensions on --file-ext.

For example:

html-minifier --input-dir _site --output-dir _dist --file-ext html,htm,json,xml,yml,yaml

This can filter out all supported extensions html,htm,json,xml,yml,yaml in one go.

@yumin-chen
Copy link
Author

Addresses issues: #896 feature request: allow multiple file-extensions in CLI

@yumin-chen yumin-chen marked this pull request as ready for review May 14, 2019 08:01
cli.js Outdated
@@ -262,7 +262,7 @@ function processDirectory(inputDir, outputDir, fileExt) {
else if (stat.isDirectory()) {
processDirectory(inputFile, outputFile, fileExt);
}
else if (!fileExt || path.extname(file) === '.' + fileExt) {
else if (!fileExt || fileExt.includes(path.extname(file).substring(1))) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use ~fileExt.indexOf(path.extname(file).slice(1)) instead.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks. I wasn't aware Arrays.includes is an ES7 feature. :) Updated the pull request with an amend and a force push.

@alexlamsl
Copy link
Collaborator

@kangax very sorry to bother you again, but looks like Travis can't build PR branches from forked repositories 😅

https://travis-ci.com/kangax/html-minifier/requests

@alexlamsl
Copy link
Collaborator

@kangax so I think given all the recent hassle, it's best if we:

  • enable all webhooks for Travis CI
  • disable whatever "branch protection" settings on GitHub

... since it's better to have some progress than none at all.

@alexlamsl
Copy link
Collaborator

@kangax any luck?

@kangax
Copy link
Owner

kangax commented Jun 4, 2019

@alexlamsl sorry, been travelling. Wish I could just give you access to travis. I'll try to get to it today/tomorrow.

@yumin-chen
Copy link
Author

@kangax @alexlamsl Any update?

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