@@ -189,7 +189,7 @@ program.option('-c --config-file <file>', 'Use config file', function(configPath
189
189
} ) ;
190
190
program . option ( '--input-dir <dir>' , 'Specify an input directory' ) ;
191
191
program . option ( '--output-dir <dir>' , 'Specify an output directory' ) ;
192
- program . option ( '--file-ext <text>' , 'Specify an extension to be read, ex: html' ) ;
192
+ program . option ( '--file-ext <text>' , 'Specify extensions to be read, separated by commas, ex: html,htm,xml ' ) ;
193
193
var content ;
194
194
program . arguments ( '[files...]' ) . action ( function ( files ) {
195
195
content = files . map ( readFile ) . join ( '' ) ;
@@ -262,7 +262,7 @@ function processDirectory(inputDir, outputDir, fileExt) {
262
262
else if ( stat . isDirectory ( ) ) {
263
263
processDirectory ( inputFile , outputFile , fileExt ) ;
264
264
}
265
- else if ( ! fileExt || path . extname ( file ) === '.' + fileExt ) {
265
+ else if ( ! fileExt || ~ fileExt . indexOf ( path . extname ( file ) . slice ( 1 ) ) ) {
266
266
mkdir ( outputDir , function ( ) {
267
267
processFile ( inputFile , outputFile ) ;
268
268
} ) ;
@@ -295,6 +295,9 @@ if (inputDir || outputDir) {
295
295
else if ( ! outputDir ) {
296
296
fatal ( 'You need to specify where to write the output files with the option --output-dir' ) ;
297
297
}
298
+ if ( fileExt ) {
299
+ fileExt = fileExt . split ( ',' ) ;
300
+ }
298
301
processDirectory ( inputDir , outputDir , fileExt ) ;
299
302
}
300
303
// Minifying one or more files specified on the CMD line
0 commit comments