Skip to content

Commit

Permalink
fix: Add only directories in a glob root config (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
tleunen committed Feb 5, 2017
1 parent a8e2689 commit ac87924
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import path from 'path';
import fs from 'fs';
import glob from 'glob';
import findBabelConfig from 'find-babel-config';
import getRealPath from './getRealPath';
Expand Down Expand Up @@ -28,7 +29,9 @@ export function manipulatePluginOptions(pluginOpts) {
// eslint-disable-next-line no-param-reassign
pluginOpts.root = pluginOpts.root.reduce((resolvedDirs, dirPath) => {
if (glob.hasMagic(dirPath)) {
return resolvedDirs.concat(glob.sync(dirPath));
return resolvedDirs.concat(
glob.sync(dirPath).filter(p => fs.lstatSync(p).isDirectory()),
);
}
return resolvedDirs.concat(dirPath);
}, []);
Expand Down

0 comments on commit ac87924

Please sign in to comment.