feat: add --resursive and --ignore options (#24)

`--resursive`: Create/update index files recursively. Halts on any unsafe "index.js" files.

`--ignore-unsafe`: Ignores unsafe "index.js" files instead of halting.
This commit is contained in:
laggingreflex
2016-11-30 05:30:34 +00:00
committed by Gajus Kuizinas
parent 2450b7202e
commit 219f546c67
8 changed files with 85 additions and 41 deletions
+4 -2
View File
@@ -37,10 +37,12 @@ const removeDuplicates = (files) => {
});
};
export default (directoryPath) => {
export default (directoryPath, options = {}) => {
let children;
validateTargetDirectory(directoryPath);
if (!validateTargetDirectory(directoryPath, {silent: options.silent})) {
return false;
}
children = fs.readdirSync(directoryPath);