From b76a175ad9e35f49862f4ea52afae0f1bc8dc94d Mon Sep 17 00:00:00 2001 From: sumeyye Date: Thu, 25 Sep 2025 13:32:43 +0300 Subject: [PATCH] fix: `package.json` file check for `compare function` --- npm/scripts/validate-versions.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/npm/scripts/validate-versions.ts b/npm/scripts/validate-versions.ts index a5a53617d7..616c04adc5 100644 --- a/npm/scripts/validate-versions.ts +++ b/npm/scripts/validate-versions.ts @@ -35,11 +35,18 @@ async function compare() { for (let i = 0; i < packageFolders.length; i++) { const folder = packageFolders[i]; const pkgJsonPath = `${packagesPath}/${folder}/package.json`; + + if (!(await fse.pathExists(pkgJsonPath))) { + continue; + } + let pkgJson; try { pkgJson = await fse.readJSON(pkgJsonPath); - } catch (error) {} + } catch (error) { + continue; + } if ( !excludedPackages.includes(pkgJson.name) &&