Skip to content

Instantly share code, notes, and snippets.

@lsongdev
Created May 7, 2015 11:36
Show Gist options
  • Select an option

  • Save lsongdev/7e3a38d06d51d03b6614 to your computer and use it in GitHub Desktop.

Select an option

Save lsongdev/7e3a38d06d51d03b6614 to your computer and use it in GitHub Desktop.
#!/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