-
-
Save BlaayLock/4cd8c75916c0505957314ed78fdf7f8f to your computer and use it in GitHub Desktop.
boostrap nested npm modules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# boostrap nested npm modules installation | |
npm-boot() { | |
local INIT_DIR=$PWD | |
# go through all packages and install their dependencies | |
for package in `ls ./**/package.json | grep -v node_modules` | |
do | |
cd $INIT_DIR | |
cd $(dirname $package) | |
echo "Installing modules for $PWD" | |
# hack to make npm install common deps into the INIT_DIR | |
npm install --global --prefix=$INIT_DIR | |
done | |
cd $INIT_DIR | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment