fix(docs): reject sync publish flag values

This commit is contained in:
Vincent Koc
2026-06-21 20:13:50 +02:00
parent 03ce3d41b1
commit 43e00c06c3
2 changed files with 2 additions and 1 deletions

View File

@@ -172,7 +172,7 @@ const GENERATED_LOCALES = [
function readOptionValue(argv, index, optionName) {
const value = argv[index + 1];
if (value === undefined || value === "" || value.startsWith("--")) {
if (value === undefined || value === "" || value.startsWith("-")) {
throw new Error(`${optionName} requires a value`);
}
return value;

View File

@@ -41,6 +41,7 @@ describe("docs-sync-publish", () => {
expect(() => parseArgs([flag, "--target", "generated-docs"])).toThrow(
`${flag} requires a value`,
);
expect(() => parseArgs([flag, "-h"])).toThrow(`${flag} requires a value`);
}
});
});