fix(schematics): ignore errors when the tools directory already exists

This commit is contained in:
Victor Savkin 2018-04-07 07:45:37 -04:00
parent fba3b24958
commit 2a377fe643

View File

@ -4,8 +4,12 @@ import * as path from 'path';
export default {
description: 'Add tools directory',
run: () => {
mkdirSync('tools');
mkdirSync(path.join('tools', 'schematics'));
try {
mkdirSync('tools');
} catch (e) {}
try {
mkdirSync(path.join('tools', 'schematics'));
} catch (e) {}
writeFileSync(path.join('tools', 'schematics', '.gitkeep'), '');
}
};