Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions hook
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ if [[ -z "$HAS_NODE" ]]; then
source_home_file ".bash_profile" || source_home_file ".zshrc" || source_home_file ".bashrc" || true
fi

[ "$NVM_DIR" = "" ] && export NVM_DIR="$HOME/.nvm"
if [ -f "$NVM_DIR/nvm.sh" ]; then
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
fi

NODE=`which node 2> /dev/null`
NODEJS=`which nodejs 2> /dev/null`
IOJS=`which iojs 2> /dev/null`
Expand All @@ -37,6 +43,10 @@ elif [[ -x "$LOCAL" ]]; then
BINARY="$LOCAL"
fi

if [ ! -f "$BINARY" ]; then
echo "something wrong: node not exist"
exit 1
fi
#
# Add --dry-run cli flag support so we can execute this hook without side affects
# and see if it works in the current environment
Expand Down