Skip to content

A platform for community discussion. Free, open, simple.

DEV: Improve app/assets/javascripts cleanup (#35550)

David Taylora39421fa0714
diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs
index f73af57e741..91c1bc55e37 100644
--- a/.pnpmfile.cjs
+++ b/.pnpmfile.cjs
@@ -26,15 +26,17 @@ if (fs.existsSync(`${discourseRoot}/${oldFrontendPath}`)) {
);
execSync(`git clean -f -X ${oldFrontendPath}`, { cwd: discourseRoot });
- const anyFiles = !!execSync(
- `find "${oldFrontendPath}" -mindepth 1 -type f -print -quit`,
- { encoding: "utf8", cwd: discourseRoot }
- ).trim();
+ if (fs.existsSync(`${discourseRoot}/${oldFrontendPath}`)) {
+ const anyFiles = !!execSync(
+ `find "${oldFrontendPath}" -mindepth 1 -type f -print -quit`,
+ { encoding: "utf8", cwd: discourseRoot }
+ ).trim();
- if (!anyFiles) {
- fs.rmSync(oldFrontendPath, {
- recursive: true,
- });
+ if (!anyFiles) {
+ fs.rmSync(oldFrontendPath, {
+ recursive: true,
+ });
+ }
}
}