feat(reporting-governance): schema-validate profile generation
This commit is contained in:
@@ -12,14 +12,19 @@ function main() {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const sourcePath = path.resolve(sourcePathArg);
|
||||
const outputPath = path.resolve(outputPathArg);
|
||||
const artifact = generateDeploymentProfileArtifactFromFile(sourcePath);
|
||||
validateDeploymentProfileArtifact(artifact);
|
||||
try {
|
||||
const sourcePath = path.resolve(sourcePathArg);
|
||||
const outputPath = path.resolve(outputPathArg);
|
||||
const artifact = generateDeploymentProfileArtifactFromFile(sourcePath);
|
||||
validateDeploymentProfileArtifact(artifact);
|
||||
|
||||
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
||||
fs.writeFileSync(outputPath, JSON.stringify(artifact, null, 2) + '\n', 'utf8');
|
||||
console.log(JSON.stringify({ ok: true, sourcePath, outputPath, profileId: artifact.metadata.id }, null, 2));
|
||||
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
||||
fs.writeFileSync(outputPath, JSON.stringify(artifact, null, 2) + '\n', 'utf8');
|
||||
console.log(JSON.stringify({ ok: true, sourcePath, outputPath, profileId: artifact.metadata.id }, null, 2));
|
||||
} catch (error) {
|
||||
console.error(`profile artifact generation failed: ${error instanceof Error ? error.message : String(error)}`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
|
||||
Reference in New Issue
Block a user