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
+5
View File
@@ -43,5 +43,10 @@ describe('validateTargetDirectory()', () => {
}).to.throw(Error, '"' + path.resolve(fixturesPath, 'unsafe-index/index.js') + '" unsafe index.');
});
});
context('unsafe ignored', () => {
it('returns false', () => {
expect(validateTargetDirectory(path.resolve(fixturesPath, 'unsafe-index'), {silent: true})).to.equal(false);
});
});
});
});