Skip to content

Commit

Permalink
feat: Add a CLI to the repository
Browse files Browse the repository at this point in the history
Add a CLI to the repository with a single command to list the versions of `aws-cdk` in use.
  • Loading branch information
akash1810 committed Jul 14, 2021
1 parent f87b5a3 commit 7b6b73b
Show file tree
Hide file tree
Showing 6 changed files with 244 additions and 45 deletions.
5 changes: 5 additions & 0 deletions bin/gu-cdk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env node

// The file `index.js` is created at build time.
// To use the CLI locally run `./script/cli`.
require('../lib/bin/index.js');
204 changes: 161 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"files": [
"lib"
],
"bin": {
"gu-cdk": "bin/gu-cdk"
},
"repository": "github:guardian/cdk",
"scripts": {
"build": "tsc",
Expand All @@ -28,6 +31,7 @@
"@types/git-url-parse": "^9.0.1",
"@types/jest": "^26.0.24",
"@types/node": "16.3.2",
"@types/yargs": "^17.0.2",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^7.29.0",
"eslint-plugin-custom-rules": "file:tools/eslint",
Expand Down Expand Up @@ -60,7 +64,8 @@
"aws-sdk": "^2.945.0",
"execa": "^5.1.1",
"git-url-parse": "^11.5.0",
"read-pkg-up": "7.0.1"
"read-pkg-up": "7.0.1",
"yargs": "^17.0.1"
},
"config": {
"commitizen": {
Expand Down
6 changes: 6 additions & 0 deletions src/bin/commands/aws-cdk-version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { LibraryInfo } from "../../constants/library-info";

export const awsCdkVersionCommand = (verbose: boolean): void => {
const response = verbose ? JSON.stringify(LibraryInfo.AWS_CDK_VERSIONS) : LibraryInfo.AWS_CDK_VERSION;
console.log(response);
};
Loading

0 comments on commit 7b6b73b

Please sign in to comment.