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:
committed by
Gajus Kuizinas
parent
2450b7202e
commit
219f546c67
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user