From e50f65976e6a56ff0d559b1b33075d7cca939884 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Sun, 5 Oct 2014 14:34:47 +0300 Subject: [PATCH] .bashrc: Only add node binaries to path if we have npm Signed-off-by: Alan Orth --- .bashrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index ada863d..7ba0f15 100644 --- a/.bashrc +++ b/.bashrc @@ -31,7 +31,12 @@ PROMPT_COMMAND="$TITLEBAR" ANSIBLE_HOSTS=hosts # look for Node binaries in current directory -PATH=$PATH:node_modules/.bin +# if we have npm, we probably want to use npm binaries +# I don't like installing globally (npm -g), so add local +# node modules' bin to PATH +if test $(which npm); then + PATH=$PATH:node_modules/.bin +fi # If a private bin directory exists, add it to PATH [[ -d ~/bin ]] && PATH="$PATH:~/bin"