fix: use the more portable CDK executable for cdk overrides#4808
fix: use the more portable CDK executable for cdk overrides#4808mergify[bot] merged 3 commits intoaws:mainlinefrom
Conversation
2d8de08 to
b35ba2a
Compare
|
🍕 Here are the new binary sizes!
|
| // We assume that a node_modules/ dir is present with the CDK downloaded after running "npm install". | ||
| // This way clients don't need to install the CDK toolkit separately. | ||
| cmd := cdk.exec.Command(filepath.Join("node_modules", "aws-cdk", "bin", "cdk"), "synth", "--no-version-reporting") | ||
| cmd := cdk.exec.Command(filepath.Join("node_modules", ".bin", "cdk"), "synth", "--no-version-reporting") |
There was a problem hiding this comment.
What does the .bin/cdk file's content look like out of curiosity?
There was a problem hiding this comment.
I think it looks the same as aws-cdk/bin/cdk on Unix systems, but on Windows it looked different! After I got home I can check on my little Windows machine.
Putting the DNM label on so that i can post the snippet before it's merged!
There was a problem hiding this comment.
(on windows) node_modules/.bin/cdk:
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../aws-cdk/bin/cdk" "$@"
else
exec node "$basedir/../aws-cdk/bin/cdk" "$@"
fi
(on mac) node_modules/.bin/cdk
#!/usr/bin/env node
require('./cdk.js');
Codecov Report
@@ Coverage Diff @@
## mainline #4808 +/- ##
=========================================
Coverage 70.05% 70.05%
=========================================
Files 287 287
Lines 41126 41126
Branches 280 280
=========================================
Hits 28810 28810
Misses 10929 10929
Partials 1387 1387
|
The old one points to a script with shebang line, which is ignored by Windows. As a result, when I used cdk overrides on Windows, it ends up not being able to interprete the cdk.js file
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.