Skip to content

Commit 53f15ec

Browse files
authored
chore(scripts): use Node.js fs to copy Smithy folders instead of shell (#6881)
1 parent e38c94b commit 53f15ec

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

scripts/copy-smithy-dist-files.js

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,20 @@ const adjacentSmithyPkgs = fs.readdirSync(smithyPackages);
2020
if (!fs.existsSync(path.join(smithyPackages, smithyPkg, "dist-cjs"))) {
2121
continue;
2222
}
23-
await Promise.all([
24-
spawnProcess("cp", [
25-
"-r",
26-
path.join(smithyPackages, smithyPkg, "dist-cjs"),
27-
path.join(node_modules, "@smithy", smithyPkg),
28-
]),
29-
spawnProcess("cp", [
30-
"-r",
31-
path.join(smithyPackages, smithyPkg, "dist-types"),
32-
path.join(node_modules, "@smithy", smithyPkg),
33-
]),
34-
spawnProcess("cp", [
35-
"-r",
36-
path.join(smithyPackages, smithyPkg, "dist-es"),
37-
path.join(node_modules, "@smithy", smithyPkg),
38-
]),
39-
spawnProcess("cp", [
40-
"-r",
23+
24+
const operations = [
25+
[path.join(smithyPackages, smithyPkg, "dist-cjs"), path.join(node_modules, "@smithy", smithyPkg, "dist-cjs")],
26+
[path.join(smithyPackages, smithyPkg, "dist-types"), path.join(node_modules, "@smithy", smithyPkg, "dist-types")],
27+
[path.join(smithyPackages, smithyPkg, "dist-es"), path.join(node_modules, "@smithy", smithyPkg, "dist-es")],
28+
[
4129
path.join(smithyPackages, smithyPkg, "package.json"),
42-
path.join(node_modules, "@smithy", smithyPkg),
43-
]),
44-
]);
30+
path.join(node_modules, "@smithy", smithyPkg, "package.json"),
31+
],
32+
];
33+
34+
for (const [from, to] of operations) {
35+
fs.cpSync(from, to, { recursive: true, force: true, errorOnExist: false });
36+
}
37+
process.stdout.write(".");
4538
}
4639
})();

0 commit comments

Comments
 (0)