1
0
Fork 0
mirror of https://github.com/sbrl/bin.git synced 2018-01-10 21:33:46 +00:00

Fix bugs in node-update

This commit is contained in:
Starbeamrainbowlabs 2017-06-23 21:34:21 +01:00
parent 27db941148
commit fc90ae7149

View file

@ -11,7 +11,7 @@ echo "> Setting ownership of /usr/local to $USER"
sudo chown -R ${USER}:${USER} /usr/local
echo "> Moving extracted node.js binaries"
if [[ "$(pwd)" -ne "/usr/local/lib" ]]; then
if [ "$(pwd)" != "/usr/local/lib" ]; then
rm -rf /usr/local/lib/${NODEJS} && mv ${NODEJS} /usr/local/lib
fi
@ -20,5 +20,8 @@ sudo rm -f /usr/local/bin/{iojs,node,npm,node-gyp}
ln -s /usr/local/lib/${NODEJS}/bin/node /usr/local/bin/node
ln -s /usr/local/lib/${NODEJS}/bin/npm /usr/local/bin/npm
echo "> Global prefix"
npm config set prefix /usr/local
echo "node.js version: $(node -v), npm version: $(npm -v)"