Skip to content

Commit 7ce094d

Browse files
author
github-actions
committed
chore: self mutation
Signed-off-by: github-actions <[email protected]>
1 parent 1b87c79 commit 7ce094d

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

packages/aws-cdk/lib/cli/cli-type-registry.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,10 +842,11 @@
842842
},
843843
"template-path": {
844844
"type": "string",
845-
"desc": "Path to a specific template within a multi-template repository (used with --from-path)",
845+
"desc": "Path to a specific template within a multi-template repository (requires --from-path)",
846846
"requiresArg": true
847847
}
848-
}
848+
},
849+
"check": "(argv: any) => { if (argv.templatePath && !argv.fromPath) { throw new Error(\"--template-path requires --from-path to be specified\"); } return true; }"
849850
},
850851
"migrate": {
851852
"description": "Migrate existing AWS resources into a CDK app",

packages/aws-cdk/lib/cli/parse-command-line-arguments.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// GENERATED FROM packages/aws-cdk/lib/cli/cli-config.ts.
33
// Do not edit by hand; all changes will be overwritten at build time from the config file.
44
// -------------------------------------------------------------------------------------------
5-
/* eslint-disable @stylistic/max-len, @typescript-eslint/consistent-type-imports */
5+
/* eslint-disable @stylistic/max-len, @typescript-eslint/consistent-type-imports, @cdklabs/no-throw-default-error */
66
import { Argv } from 'yargs';
77
import * as helpers from './util/yargs-helpers';
88

@@ -835,7 +835,7 @@ export function parseCommandLineArguments(args: Array<string>): any {
835835
.option('template-path', {
836836
default: undefined,
837837
type: 'string',
838-
desc: 'Path to a specific template within a multi-template repository (used with --from-path)',
838+
desc: 'Path to a specific template within a multi-template repository (requires --from-path)',
839839
requiresArg: true,
840840
}),
841841
)
@@ -973,6 +973,12 @@ export function parseCommandLineArguments(args: Array<string>): any {
973973
conflicts: ['enable', 'disable'],
974974
}),
975975
)
976+
.check((argv: any) => {
977+
if (argv.templatePath && !argv.fromPath) {
978+
throw new Error('--template-path requires --from-path to be specified');
979+
}
980+
return true;
981+
})
976982
.version(helpers.cliVersion())
977983
.demandCommand(1, '')
978984
.recommendCommands()

packages/aws-cdk/lib/cli/user-input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ export interface InitOptions {
13341334
readonly fromPath?: string;
13351335

13361336
/**
1337-
* Path to a specific template within a multi-template repository (used with --from-path)
1337+
* Path to a specific template within a multi-template repository (requires --from-path)
13381338
*
13391339
* @default - undefined
13401340
*/

0 commit comments

Comments
 (0)