feat: add --extension/-x parameter overwrite default .js extension parser (#35)

This commit is contained in:
Guillaume Boddaert
2017-01-30 09:56:50 +00:00
committed by Gajus Kuizinas
parent 7353f04394
commit 5fea5e63d7
11 changed files with 79 additions and 6 deletions
+5 -1
View File
@@ -20,6 +20,7 @@ export default (directoryPaths, options = {}) => {
} else {
log('Recursive:', options.recursive ? chalk.green('true') : chalk.red('false'));
log('Ignore unsafe:', options.ignoreUnsafe ? chalk.green('true') : chalk.red('false'));
log('Extensions:', chalk.green(options.extensions));
}
if (options.updateIndex || options.recursive) {
@@ -43,7 +44,10 @@ export default (directoryPaths, options = {}) => {
_.forEach(sortedDirectoryPaths, (directoryPath) => {
let existingIndexCode;
const siblings = readDirectory(directoryPath, {silent: options.ignoreUnsafe});
const siblings = readDirectory(directoryPath, {
extensions: options.extensions,
silent: options.ignoreUnsafe
});
const indexCode = createIndexCode(siblings, {
banner: options.banner