diff --git a/scripts/verify-github-migration.ts b/scripts/verify-github-migration.ts index a06d715..6ded790 100644 --- a/scripts/verify-github-migration.ts +++ b/scripts/verify-github-migration.ts @@ -8,9 +8,6 @@ const themeSourceDir = join(root, "themes", "github-light"); const darkThemeSourceDir = join(root, "themes", "github-dark"); const tokenSourceDir = join(root, "styles", "tokens"); const packageJson = JSON.parse(await readFile(join(root, "package.json"), "utf8")) as { version?: string }; -const githubThemePackageJson = JSON.parse( - await readFile(join(root, ".github-theme", "package.json"), "utf8"), -) as { version?: string }; const generated = await readFile(generatedPath, "utf8"); const generatedDark = await readFile(generatedDarkPath, "utf8"); @@ -39,8 +36,20 @@ if (packageJson.version !== "1.26.1") { throw new Error(`project version must be 1.26.1, got ${packageJson.version}`); } -if (githubThemePackageJson.version !== "1.26.1") { - throw new Error(`.github-theme version must be 1.26.1, got ${githubThemePackageJson.version}`); +try { + const githubThemePackageJson = JSON.parse( + await readFile(join(root, ".github-theme", "package.json"), "utf8"), + ) as { version?: string }; + + if (githubThemePackageJson.version !== "1.26.1") { + throw new Error(`.github-theme version must be 1.26.1, got ${githubThemePackageJson.version}`); + } +} catch (error) { + const code = error instanceof Error && "code" in error ? error.code : undefined; + + if (code !== "ENOENT") { + throw error; + } } await access(join(root, "themes", "index.ts"));