Files
blitzkit/scripts/checkVersionMissMatch.ts
T
2023-11-25 21:03:29 -06:00

13 lines
378 B
TypeScript

import { readdir } from 'fs/promises';
import packageJSON from '../package.json';
const { version } = packageJSON;
const changelogs = await readdir('docs/changelogs');
const hasVersion = changelogs.includes(`${version}.md`);
if (hasVersion) {
console.log(`Version ${version} found in changelogs`);
} else {
throw new Error(`Version ${version} not found in changelogs`);
}