16 lines
770 B
JavaScript
16 lines
770 B
JavaScript
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 <workspace-relative-manifest>')
|
|
|
|
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`)
|