Repository navigation
fix(cli): preserve symlinks in the standalone cli zip - #2192
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Automated review A maintainer will still review this — treat the notes below as a starting point. 📌 Commit This PR fixes the standalone Open findings: 🔴 0 blocking · 🟡 0 recommended · ⚪ 0 optional. Generated automatically. React 👍 or 👎 to tell us whether this review helped, so we can improve these reviews. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2192 +/- ##
==========================================
- Coverage 92.55% 92.52% -0.04%
==========================================
Files 81 81
Lines 13224 13224
Branches 1917 1914 -3
==========================================
- Hits 12240 12236 -4
- Misses 946 950 +4
Partials 38 38
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Users without npm access (e.g. in ADC regions) can install the CLI from the standalone
aws-cdk-cli.zip. After unzipping it,./node_modules/.bin/cdk --versionfails withCannot find module '../lib'.yarn installcreatesnode_modules/.bin/cdkas a symlink to../aws-cdk/bin/cdk, but by defaultzipfollows symlinks and stores a copy of the target file. The script doesrequire('../lib'), which resolves relative to the file's own location, so from the copy in.binit looks fornode_modules/lib, which doesn't exist.This PR adds
-yto thezipcommand inprojenrc/build-standalone-zip.task.ts, so symlinks are stored as links..bin/cdkis the only symlink in the zip, so nothing else changes.Before (Built and then unzipped)
$ ls -l node_modules/.bin/cdk -rwxr-xr-x 153 node_modules/.bin/cdk $ ./node_modules/.bin/cdk --version Error: Cannot find module '../lib'After
$ ls -l node_modules/.bin/cdk lrwxr-xr-x 18 node_modules/.bin/cdk -> ../aws-cdk/bin/cdk $ ./node_modules/.bin/cdk --version 0.0.0 (build 45c3650)By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license