From c5efaf17c7f1c8794440fda35691ad6b369fd0ee Mon Sep 17 00:00:00 2001 From: Mikaela Suomalainen Date: Tue, 13 May 2014 13:07:04 +0300 Subject: [PATCH] bashrc & zshrc: add fix-node function. Closes #23 . --- bashrc | 15 +++++++++++++++ zshrc | 17 +++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/bashrc b/bashrc index 1997858f..b33ac1e2 100644 --- a/bashrc +++ b/bashrc @@ -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 diff --git a/zshrc b/zshrc index 0579062b..418a7373 100644 --- a/zshrc +++ b/zshrc @@ -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.