You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): control library init version with a command-line parameter (#149)
Allows controlling of the `cdk init` version of `aws-cdk-lib`:
```
cdk init --lib-version=1.2.3
```
Mainly intended to be used by tests (to smoke-test that upcoming library
versions still `init` properly), but it can be used by users as well.
---
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache-2.0 license
---------
Signed-off-by: github-actions <[email protected]>
Co-authored-by: github-actions <[email protected]>
Copy file name to clipboardExpand all lines: packages/aws-cdk/lib/cli/cli-config.ts
+1
Original file line number
Diff line number
Diff line change
@@ -345,6 +345,7 @@ export async function makeConfig(): Promise<CliConfig> {
345
345
'language': {type: 'string',alias: 'l',desc: 'The language to be used for the new project (default can be configured in ~/.cdk.json)',choices: awaitavailableInitLanguages()},
346
346
'list': {type: 'boolean',desc: 'List the available templates'},
347
347
'generate-only': {type: 'boolean',default: false,desc: 'If true, only generates project files, without executing additional operations such as setting up a git repo, installing dependencies or compiling the project'},
348
+
'lib-version': {type: 'string',alias: 'V',default: undefined,desc: 'The version of the CDK library (aws-cdk-lib) to initialize the project with. Defaults to the version that was current when this CLI was built.'},
Copy file name to clipboardExpand all lines: packages/aws-cdk/lib/cli/parse-command-line-arguments.ts
+6
Original file line number
Diff line number
Diff line change
@@ -744,6 +744,12 @@ export function parseCommandLineArguments(args: Array<string>): any {
744
744
default: false,
745
745
type: 'boolean',
746
746
desc: 'If true, only generates project files, without executing additional operations such as setting up a git repo, installing dependencies or compiling the project',
747
+
})
748
+
.option('lib-version',{
749
+
default: undefined,
750
+
type: 'string',
751
+
alias: 'V',
752
+
desc: 'The version of the CDK library (aws-cdk-lib) to initialize the project with. Defaults to the version that was current when this CLI was built.',
747
753
}),
748
754
)
749
755
.command('migrate','Migrate existing AWS resources into a CDK app',(yargs: Argv)=>
0 commit comments