Skip to content

Commit 42a2b1a

Browse files
committed
fix: do not delete tests folders from clients
1 parent 6943374 commit 42a2b1a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/generate-clients/copy-to-clients.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,13 @@ const copyToClients = async (sourceDir, destinationDir) => {
9797
};
9898
writeFileSync(destSubPath, JSON.stringify(mergedManifest, null, 2).concat(`\n`));
9999
} else if (["src", "tests", "LICENSE"].includes(packageSub) || !existsSync(destSubPath)) {
100-
if (lstatSync(packageSubPath).isDirectory()) removeSync(destSubPath);
100+
if (packageSub === "src") {
101+
// Remove only non-tests from src folder
102+
for (const fileName of readdirSync(destSubPath)) {
103+
if (["test", "e2e"].includes(fileName)) continue;
104+
removeSync(join(destSubPath, fileName));
105+
}
106+
} else if (lstatSync(packageSubPath).isDirectory()) removeSync(destSubPath);
101107
copySync(packageSubPath, destSubPath, {
102108
overwrite: true,
103109
});

0 commit comments

Comments
 (0)