import { readFile } from 'node:fs/promises' import path from 'node:path' import { fileURLToPath } from 'node:url' import { validateAssetBuildManifest } from './asset-build-manifest.mjs' const scriptDirectory = path.dirname(fileURLToPath(import.meta.url)) const workspace = path.resolve(scriptDirectory, '..', '..') const manifestArgument = process.argv[2] if (!manifestArgument) throw new Error('Usage: node validate-asset-build-manifest.mjs ') const manifestPath = path.resolve(workspace, manifestArgument) const manifest = JSON.parse(await readFile(manifestPath, 'utf8')) validateAssetBuildManifest(manifest, workspace) process.stdout.write(`ASSET-BUILD-MANIFEST PASS ${path.relative(workspace, manifestPath).replaceAll('\\', '/')}\n`)