From 50efb009946cb736b83e3411116163cf56d57c2b Mon Sep 17 00:00:00 2001 From: Nick Martin Date: Wed, 22 Feb 2012 21:41:47 -0800 Subject: [PATCH] Allow passing PREFIX to ./install.sh. --- install.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index e5e2b3b2f45..bded6a78dae 100755 --- a/install.sh +++ b/install.sh @@ -2,8 +2,12 @@ cd `dirname $0` -PARENT="/usr/local" -TARGET_DIR="/usr/local/meteor" +if [ "$PREFIX" != "" ] ; then + PARENT="$PREFIX" +else + PARENT="/usr/local" +fi +TARGET_DIR="$PARENT/meteor" # XXX try to fix it up automatically? if [ ! -d "$PARENT" -o ! -w "$PARENT" ] ; then @@ -14,6 +18,8 @@ elif [ -d "$PARENT/bin" -a ! -w "$PARENT/bin" ] ; then exit 1 fi +echo "Installing in $PARENT" + rm -rf "$TARGET_DIR" # make sure dev bundle exists before trying to install