Skip to content

Commit

Permalink
Fix symlink generating script to properly link @aws-cdk scoped packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Rico Huijbers authored and rix0rrr committed Jun 19, 2018
1 parent c4b9abd commit 19cbb55
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions link-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,19 @@
set -euo pipefail
root="$(cd $(dirname $0) && pwd)"

mkdir -p node_modules

modules="$(find ${root}/packages -name package.json | grep -v node_modules | grep -v init-templates | xargs -n1 dirname)"
for module in ${modules}; do
echo "${module} => node_modules/$(basename ${module})"
ln -s ${module} node_modules/
if [[ $(basename $(dirname $module)) == @* ]]; then
# This is a @scope/based package
scope=$(basename $(dirname $module))
link_dir=node_modules/$(basename $(dirname $module))
mkdir -p $link_dir
else
link_dir=node_modules
fi

echo "${module} => $link_dir/$(basename $module)"
ln -fs ${module} $link_dir
done

0 comments on commit 19cbb55

Please sign in to comment.