Incognito-Wiki/scripts/check-migration.mjs
msa46 bcb8dcfe2a
Some checks are pending
Deploy to GitHub Pages / build (push) Waiting to run
Deploy to GitHub Pages / deploy (push) Blocked by required conditions
fix: resolve final Starlight migration review
2026-08-02 18:59:28 +02:00

20 lines
960 B
JavaScript

import { resolve } from 'node:path';
import { checkDestinations, loadManifest, validateManifest } from './lib/migration.mjs';
const allowMissing = process.argv.slice(2).includes('--allow-missing');
const manifest = await loadManifest('docs/migration-manifest.json');
const { entries } = validateManifest(manifest);
const result = await checkDestinations({ entries }, resolve('.'));
console.log(`Migration manifest accounts for ${result.total} source pages.`);
for (const destination of result.missing) {
console.log(`Missing destination: ${destination}`);
}
for (const destination of result.notFiles) {
console.log(`Destination is not a regular file: ${destination}`);
}
if ((result.missing.length > 0 && !allowMissing) || result.notFiles.length > 0) {
console.error(`Migration check failed: ${result.missing.length} destination file(s) are missing and ${result.notFiles.length} destination path(s) are not regular files.`);
process.exitCode = 1;
}