fix(report): require ownership markdown path

This commit is contained in:
Vincent Koc
2026-06-06 22:18:03 +02:00
parent c2af0475fe
commit bedb3e61c6
2 changed files with 31 additions and 2 deletions
@@ -397,7 +397,15 @@ function printTextReport(report) {
process.stdout.write(renderTextReport(report));
}
function parseArgs(argv) {
function readArtifactPath(argv, index, optionName) {
const value = argv[index + 1];
if (value === undefined || value === "" || value.startsWith("--")) {
throw new Error(`${optionName} requires a value`);
}
return value;
}
export function parseArgs(argv) {
const options = {
asJson: false,
check: false,
@@ -421,7 +429,8 @@ function parseArgs(argv) {
continue;
}
if (arg === "--markdown") {
options.markdownPath = argv[++index];
options.markdownPath = readArtifactPath(argv, index, arg);
index += 1;
continue;
}
throw new Error(`Unsupported argument: ${arg}`);