A platform for community discussion. Free, open, simple.
DEV: Replace node globSync with `find` (#35501)
David Taylor883ec80a77bf
diff --git a/.pnpmfile.cjs b/.pnpmfile.cjsindex f38d20d4557..4c2d77a81a3 100644--- a/.pnpmfile.cjs+++ b/.pnpmfile.cjs@@ -29,11 +29,10 @@ if (fs.existsSync(`${oldAdminPath}/node_modules`)) {recursive: true,});- const anyFiles = fs- .globSync(`${oldAdminPath}/**/*`, {- withFileTypes: true,- })- .some((dirent) => dirent.isFile());+ const anyFiles = !!execSync(+ `find "${oldAdminPath}" -mindepth 1 -type f -print -quit`,+ { encoding: "utf8" }+ ).trim();if (!anyFiles) {fs.rmSync(oldAdminPath, {