Skip to content

Instantly share code, notes, and snippets.

@chrisyip chrisyip/iojs.sh

Last active Feb 16, 2016
Embed
What would you like to do?
Get latest installed node from nvm path
#!/usr/bin/env sh
if [ -d "$(brew --prefix)/Cellar" ]; then
node=`find /usr/local/Cellar -name node | grep iojs/.*/bin/node`
if [ ! -z "$node" ]; then
$node $@
else
echo "io.js not installed"
fi
else
echo "Homebrew folder not found"
fi
#!/usr/bin/env sh
# Change this to your nvm path
nvm_path="$HOME/.nvm/versions"
if [ -d $nvm_path ]; then
node=`find $nvm_path/**/*/bin/node | sort -nr | cut -f2`
if [ ! -z "$node" ]; then
for n in $node
do
$n $@
break
done
else
echo "node.js or io.js not installed"
fi
else
echo "nvm folder not found"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.