Skip to content

Commit 426589a

Browse files
committed
⏪ Reincludes id label validation
1 parent 4c2a428 commit 426589a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/spec-node/devContainersSpecCLI.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ function provisionOptions(y: Argv) {
144144
'include-merged-configuration': { type: 'boolean', default: false, description: 'Include merged configuration in result.' },
145145
})
146146
.check(argv => {
147+
const idLabels = (argv['id-label'] && (Array.isArray(argv['id-label']) ? argv['id-label'] : [argv['id-label']])) as string[] | undefined;
148+
if (idLabels?.some(idLabel => !/.+=.+/.test(idLabel))) {
149+
throw new Error('Unmatched argument format: id-label must match <name>=<value>');
150+
}
147151
const mounts = (argv.mount && (Array.isArray(argv.mount) ? argv.mount : [argv.mount])) as string[] | undefined;
148152
if (mounts?.some(mount => !mountRegex.test(mount))) {
149153
throw new Error('Unmatched argument format: mount must match type=<bind|volume>,source=<source>,target=<target>[,external=<true|false>]');

0 commit comments

Comments
 (0)