Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ $ awslocal sns list-topics

## Change Log

* 3.0.1: Using the `-v`/`--version` flag prints the cdklocal version and the version of the underlying `aws-cdk` package (if possible)
* 3.0.0: Sanitise environment of configuration environment variables before deployment
* 2.19.2: Fix SDK compatibility with aws-cdk versions >= 2.177.0
* 2.19.1: Fix SDK compatibility with older CDK versions; Fix patched bucket location in TemplateURL
Expand Down
20 changes: 19 additions & 1 deletion bin/cdklocal
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const https = require("https");
const crypto = require("crypto");
const net = require('net');

const { isEnvTrue, EDGE_PORT, PROTOCOL, configureEnvironment } = require("../src");
const { isEnvTrue, EDGE_PORT, PROTOCOL, configureEnvironment } = require(path.resolve(__dirname, "..", "src"));
const pkg = require(path.resolve(__dirname, "..", "package.json"));

// constants and custom config values

Expand All @@ -22,6 +23,17 @@ const AWS_ENVAR_ALLOWLIST = process.env.AWS_ENVAR_ALLOWLIST || "";
// UTIL FUNCTIONS
//----------------

function printVersion() {
try {
const lib = require("aws-cdk/lib");
const cdkVersion = require(path.join(lib.rootDir(), 'package.json')).version.replace(/\+[0-9a-f]+$/, '');
console.log(`cdklocal v${pkg.version}`);
console.log(`cdk cli version v${cdkVersion}`);
} catch (e) {
console.log(`cdklocal v${pkg.version}`);
}
}

const getLocalEndpoint = async () => process.env.AWS_ENDPOINT_URL || `${PROTOCOL}://${await getLocalHost()}`;

var resolvedHostname = undefined;
Expand Down Expand Up @@ -484,6 +496,12 @@ const patchPost_2_14 = () => {
}
};

// handle printing version information
if (process.argv[2] === "--version" || process.argv[2] === "-v") {
printVersion();
process.exit(0);
}

if (isEsbuildBundle()) {
// load for CDK version 2.14.0 and above
// (v2.14.0+ uses a self-contained bundle, see https://github.com/aws/aws-cdk/pull/18667)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "aws-cdk-local",
"description": "CDK Toolkit for use with LocalStack",
"version": "3.0.0",
"version": "3.0.1",
"main": "src/index.js",
"bin": {
"cdklocal": "bin/cdklocal"
Expand Down