Skip to content

Commit

Permalink
ignore empty dirs as well
Browse files Browse the repository at this point in the history
  • Loading branch information
iliapolo committed Mar 20, 2022
1 parent 6a1eb81 commit df92e64
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/@aws-cdk/node-bundle/src/api/bundle.ts
Expand Up @@ -224,9 +224,12 @@ export class Bundle {

const target = fs.mkdtempSync(path.join(os.tmpdir(), 'bundle-write-'));

// we definitely don't need these directories in the package
// so no need to copy them over.
const ignoreDirectories = ['node_modules', '.git'];

// copy the entire project since we are retaining the original files.
// except for `node_modules` and `.git` directories which definitely don't belong in the package.
fs.copySync(this.packageDir, target, { filter: n => !n.includes(`node_modules${path.sep}`) && !n.includes(`.git${path.sep}`) });
fs.copySync(this.packageDir, target, { filter: n => !n.split(path.sep).some((p => ignoreDirectories.includes(p))) });

// clone the original manifest since we are going to
// to mutate it.
Expand Down

0 comments on commit df92e64

Please sign in to comment.