Skip to content

Commit

Permalink
fix(toolkit): ignore hidden files for 'cdk init'
Browse files Browse the repository at this point in the history
Don't block 'cdk init' on the presence of files start with '.'.

In particular, don't care about the presence of a '.git' directory.

Fixes #1758.
  • Loading branch information
Rico Huijbers committed Feb 14, 2019
1 parent 26dbf1d commit 447465e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ async function initializeProject(template: InitTemplate, language: string, canUs

async function assertIsEmptyDirectory() {
const files = await fs.readdir(process.cwd());
if (files.length !== 0) {
if (files.filter(f => !f.startsWith('.')).length !== 0) {
throw new Error('`cdk init` cannot be run in a non-empty directory!');
}
}
Expand Down

0 comments on commit 447465e

Please sign in to comment.