Created
January 10, 2017 00:04
-
-
Save noherczeg/3f2e616a1c564602b7d5183ded4e55fb to your computer and use it in GitHub Desktop.
npm repository centralizer
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 | |
node_version="$(node -v)" | |
target=$HOME/.node_modules/$node_version | |
if [[ ! -d $target ]]; then | |
echo "Creating local central repo at: $target" | |
mkdir -p $target; | |
else | |
echo "Using central local repo at: $target" | |
fi | |
echo "Linking node_modules to local central repo..." | |
if [[ -L node_modules && -d node_modules ]]; then | |
echo "... already linked." | |
else | |
ln -s $target node_modules | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment