feat: add --extension/-x parameter overwrite default .js extension parser (#35)
This commit is contained in:
committed by
Gajus Kuizinas
parent
7353f04394
commit
5fea5e63d7
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user