From dbf63d238070705df6ffadbe2ee57afed3ba1d99 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Tue, 16 Mar 2021 15:07:06 +0100 Subject: [PATCH] chore(cloudformation-include): build fails on .DS_Store (#13595) The build script was assuming everything in the package directory was itself a directory; not necessarily true on macOS machines. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/cloudformation-include/build.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/@aws-cdk/cloudformation-include/build.js b/packages/@aws-cdk/cloudformation-include/build.js index ab36ffd345d7f..454a10a5014d5 100644 --- a/packages/@aws-cdk/cloudformation-include/build.js +++ b/packages/@aws-cdk/cloudformation-include/build.js @@ -29,6 +29,8 @@ async function main() { for (const constructLibraryDir of constructLibrariesDirs) { const absConstructLibraryDir = path.resolve(constructLibrariesRoot, constructLibraryDir); + if (!fs.statSync(absConstructLibraryDir).isDirectory()) { continue; } // .DS_Store + const libraryPackageJson = require(path.join(absConstructLibraryDir, 'package.json')); const libraryDependencyVersion = dependencies[libraryPackageJson.name];