From 45b89ab396e792d4fde190468bcc26f354377405 Mon Sep 17 00:00:00 2001 From: Isaac Wolkerstorfer Date: Tue, 25 Jan 2011 17:12:13 +0100 Subject: [PATCH] Create alias dir on demand --- nvm.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index 1706c18..c291df1 100644 --- a/nvm.sh +++ b/nvm.sh @@ -154,8 +154,9 @@ nvm() echo "# use 'nvm sync' to update from nodejs.org" ;; "alias" ) + mkdir -p $NVM_DIR/alias if [ $# -le 2 ]; then - (cd $NVM_DIR/alias; for ALIAS in `ls $2* 2>/dev/null`; do + (cd $NVM_DIR/alias && for ALIAS in `ls $2* 2>/dev/null`; do DEST=`cat $ALIAS` VERSION=`nvm_version $DEST` if [ "$DEST" = "$VERSION" ]; then