DEV: Replace node globSync with find (#35501)

`globSync` isn't available in earlier versions of node 22.

Followup to 0fcd2f12dc
This commit is contained in:
David Taylor
2025-10-20 15:34:48 +01:00
committed by GitHub
parent 1d33e72389
commit 883ec80a77
+4 -5
View File
@@ -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, {