Last active
December 28, 2015 04:38
-
-
Save DamonOehlman/7443415 to your computer and use it in GitHub Desktop.
In preparation for potentially having no net access for a while, I'm using @dominictarr's [npmd](https://github.com/dominictarr/npmd) to bring modules I need (or potentially might use down locally). I'm sure the script can use some improvements, but it works well enough for me know.Basically, head into a parent directory somewhere where you have…
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
#!/usr/bin/env bash | |
getopts ":r:" RECURSE | |
for dir in *; do | |
if [ -d "${dir}" ]; then | |
pushd "$dir" > /dev/null | |
if [ -e package.json ]; then | |
echo "reinstalling packages with npmd for: ${dir}" | |
rm -rf node_modules | |
npmd install | |
# if npmd failed, then abort | |
if [ $? -ne 0 ]; then | |
exit $? | |
fi | |
elif [ $RECURSE = ":" ]; then | |
npmd-all-the-things -r | |
fi | |
popd > /dev/null | |
fi | |
done |
Yeah this should work!
Please post an issue on any modules npmd can't install.
Made a recursive mode...
Added to djo-shell
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
seems legit