-
Notifications
You must be signed in to change notification settings - Fork 571
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
base: gh-pages
Are you sure you want to change the base?
Conversation
Addresses issues: #896 feature request: allow multiple file-extensions in CLI |
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))) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@kangax very sorry to bother you again, but looks like Travis can't build PR branches from forked repositories 😅 |
@kangax so I think given all the recent hassle, it's best if we:
... since it's better to have some progress than none at all. |
@kangax any luck? |
@alexlamsl sorry, been travelling. Wish I could just give you access to travis. I'll try to get to it today/tomorrow. |
@kangax @alexlamsl Any update? |
This pull request adds support for multiple extensions on
--file-ext
.For example:
This can filter out all supported extensions
html,htm,json,xml,yml,yaml
in one go.