bashrc & zshrc: add fix-node function. Closes #23 .

This commit is contained in:
Mikaela Suomalainen 2014-05-13 13:07:04 +03:00
parent 83ccf48080
commit c5efaf17c7
2 changed files with 32 additions and 0 deletions

15
bashrc
View File

@ -738,6 +738,21 @@ echo "I have now finished everything that I was supposed to do."
}
# This function fixes nodejs on Debian based systems.
# (Everything expects nodejs to be called as node, but it's not with Debian.)
function fix-node {
if [[ $USER = "root" && -f /usr/bin/nodejs && ! -f /usr/bin/node && ! -f /usr/local/bin/node ]] then;
ln -s /usr/bin/nodejs /usr/local/bin/node
fi
mkdir -p $HOME/.local/bin
if [[ -f /usr/bin/nodejs && ! -f /usr/bin/node && ! -f /usr/local/bin/node && ! -f $HOME/.local/bin/node ]] then;
ln -s /usr/bin/nodejs $HOME/.local/bin/node
fi
}
# .custom
if [ -f ~/.custom ]; then

17
zshrc
View File

@ -710,6 +710,23 @@ echo "I have now finished everything that I was supposed to do."
}
# This function fixes nodejs on Debian based systems.
# (Everything expects nodejs to be called as node, but it's not with Debian.)
function fix-node {
if [[ $USER = "root" && -f /usr/bin/nodejs && ! -f /usr/bin/node && ! -f /usr/local/bin/node ]] then;
ln -s /usr/bin/nodejs /usr/local/bin/node
fi
mkdir -p $HOME/.local/bin
if [[ -f /usr/bin/nodejs && ! -f /usr/bin/node && ! -f /usr/local/bin/node && ! -f $HOME/.local/bin/node ]] then;
ln -s /usr/bin/nodejs $HOME/.local/bin/node
fi
}
# Source files for miscannellious modifications.