Created
March 14, 2018 22:05
-
-
Save ASteinheiser/08961ae3f15a0ba54ce7265b40ed4bde to your computer and use it in GitHub Desktop.
This file contains 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 | |
for dir in $(ls) | |
do | |
if [ ! -f $dir/package.json ]; then | |
echo 'No modules to install for: ' $dir | |
else | |
echo 'Reinstalling node_modules for: ' $dir; | |
if [ -d $dir/node_modules/ ]; then | |
rm -rf $dir/node_modules/ | |
fi | |
npm i --cwd ./$dir --prefix ./$dir | |
rm -r $dir/etc | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment