Skip to content

Commit 9be8a0f

Browse files
Guard for unknown options
1 parent f921f51 commit 9be8a0f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

scripts/publish.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ async function publish(distTarget, tarballNamePrefix) {
306306

307307
const args = process.argv.slice(2).map((value) => value.toLowerCase());
308308
const isDevPublish = args.includes('--dev');
309+
const unknownOptions = args.filter((value) => value.startsWith('--') && value !== '--dev');
309310
const packageArgs = args.filter((value) => !value.startsWith('--'));
310311

311312
function publishCore() {
@@ -361,6 +362,10 @@ const publishPipelines = {
361362
// A release publishes whatever was asked for, defaulting to core and designsystem.
362363
// A dev publish takes exactly one package and expands it to its publish closure.
363364
function resolvePackagesToPublish() {
365+
if (unknownOptions.length > 0) {
366+
throw new Error(`Unknown option "${unknownOptions[0]}". Expected: --dev`);
367+
}
368+
364369
if (!isDevPublish) {
365370
return packageArgs.length === 0
366371
? ['core', 'designsystem']

0 commit comments

Comments
 (0)