Created
December 23, 2015 13:34
-
-
Save timdp/1ffc2af2c53ffd3591d0 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
set -e | |
[[ -f package.json && -d node_modules ]] || exit 1 | |
export PATH="/c/Program Files/Git/bin:$PATH" | |
linked=$(find node_modules -maxdepth 1 -type l -printf '%P\n') | |
echo "Linked modules:" | |
echo "$linked" | |
bak=node_modules.$(date +%s) | |
echo "Backing up node_modules to $bak ..." | |
mv node_modules $bak | |
for mod in $linked; do | |
echo "Linking $mod ..." | |
cmd /c "npm link $mod" | |
done | |
echo "Installing ..." | |
cmd /c "npm install" | |
for mod in $linked; do | |
cd node_modules/$mod | |
echo "Reinstalling $mod ..." | |
cmd /c "npm install" | |
cd "$OLDPWD" | |
done | |
echo "Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment