From c42a4edfd4b17e3c081cedb47d0fd2d35cac209b Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Fri, 13 Mar 2015 11:25:26 +0300 Subject: [PATCH] .bashrc: Change npm test logic The whole `if command ...` logic doesn't make sense to me, because the command exits with 0 if it is successful, which means false! This is just more readable anyways. Signed-off-by: Alan Orth --- .bashrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index 778da48..665e42c 100644 --- a/.bashrc +++ b/.bashrc @@ -37,8 +37,9 @@ export ANSIBLE_HOSTS=hosts # 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 >/dev/null 2>&1); then - PATH=$PATH:node_modules/.bin +command -v npm >/dev/null 2>&1 +if [[ $? -eq 0 ]]; then + export PATH=$PATH:node_modules/.bin fi # Enable pyenv