Skip to content

Commit

Permalink
fix(cli) CLI integ tests cannot be executed locally (#6482)
Browse files Browse the repository at this point in the history
symlink monorepo packages instead of using npm install
Fixes #6477

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
shivlaks and mergify[bot] authored Feb 27, 2020
1 parent 5de87c1 commit 15435a6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/aws-cdk/test/integ/run-wrappers/repo/npm
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,23 @@ if [[ "$command" == "install" || "$command" == "i" ]]; then

while [[ "${1:-}" != "" ]]; do
packageloc=$(cd $REPO_ROOT && npx lerna ls --loglevel silent -p --scope $1) && {
# Rewrite to 'npm install /path/to/@aws-cdk/pkg'
npmargs="$npmargs $packageloc"
# Symlink that location into node_modules
dir=$(dirname node_modules/$1)
mkdir -p $dir
echo "$dir/$1 -> $packageloc" >&2
ln -s $packageloc $dir/
} || {
npmargs="$npmargs $1"
}
shift
done

if [[ "$npmargs" == "install" ]]; then
# No rewrites
exit 0
fi

exec $ORIGINAL_NPM $npmargs
fi

exec $ORIGINAL_NPM "$@"
exec $ORIGINAL_NPM "$@"

0 comments on commit 15435a6

Please sign in to comment.