Created
May 7, 2015 11:36
-
-
Save lsongdev/7e3a38d06d51d03b6614 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
| #!/usr/bin/env bash | |
| BIN_NODE=/usr/local/bin/node | |
| # remove link file first . | |
| if [[ -h $BIN_NODE ]]; then | |
| rm -f /usr/local/bin/node | |
| fi | |
| TARGET_NODE=`which $1` | |
| if [[ -e $TARGET_NODE ]]; then | |
| ln -s $TARGET_NODE $BIN_NODE | |
| #ls -la `which node` | |
| echo "$1 `node --version`" | |
| else | |
| echo "file \"$1\" does not exist ." | |
| fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment