mirror of
https://github.com/discourse/discourse.git
synced 2026-08-02 09:29:37 -05:00
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:
+4
-5
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user