Skip to content

Commit 1bf5592

Browse files
AnsonhkgCopilot
andauthored
Update scripts/sync-version.mjs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Anson <ansonox@gmail.com>
1 parent c01635e commit 1bf5592

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

scripts/sync-version.mjs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,16 @@ async function main() {
2828
'version.ts'
2929
);
3030

31-
const litClientPackageJson = JSON.parse(
32-
await readFile(litClientPackageJsonPath, 'utf8')
33-
);
31+
let litClientPackageJson;
32+
try {
33+
litClientPackageJson = JSON.parse(
34+
await readFile(litClientPackageJsonPath, 'utf8')
35+
);
36+
} catch (err) {
37+
throw new Error(
38+
`Failed to read or parse package.json at ${litClientPackageJsonPath}: ${err.message}`
39+
);
40+
}
3441
const litClientVersion = litClientPackageJson.version;
3542

3643
if (!litClientVersion) {

0 commit comments

Comments
 (0)