From bd93ce971f30773ed0723ebe273de9a77563fd49 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Mon, 15 Jul 2013 18:19:19 +0200 Subject: [PATCH] make scripts cwd blind --- load-base-data.sh | 5 +++-- run.sh | 11 ++++++----- start.sh | 15 ++++++++------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/load-base-data.sh b/load-base-data.sh index d422bf266..7dcf015d1 100755 --- a/load-base-data.sh +++ b/load-base-data.sh @@ -1,6 +1,7 @@ +BASE=`dirname $0` PROJECT=authentic2 -CTL=${PROJECT}-ctl -VENV=${PROJECT}-venv +CTL=$BASE/${PROJECT}-ctl +VENV=$BASE/${PROJECT}-venv . $VENV/bin/activate # ./$CTL loaddata diff --git a/run.sh b/run.sh index d8f163178..2fa6adef8 100755 --- a/run.sh +++ b/run.sh @@ -1,11 +1,12 @@ #!/bin/sh +BASE=`dirname $0` PROJECT=authentic2 -CTL=${PROJECT}-ctl -VENV=${PROJECT}-venv +CTL=$BASE/${PROJECT}-ctl +VENV=$BASE/${PROJECT}-venv if [ ! -d $VENV ]; then - ./start.sh + $BASE/start.sh else - . ./$VENV/bin/activate - ./$CTL "${@:-runserver}" + . $VENV/bin/activate + $CTL "${@:-runserver}" fi diff --git a/start.sh b/start.sh index a05f73c6e..9bb42f0e6 100755 --- a/start.sh +++ b/start.sh @@ -1,7 +1,8 @@ #!/bin/sh +BASE=`dirname $0` PROJECT=authentic2 -CTL=${PROJECT}-ctl -VENV=${PROJECT}-venv +CTL=$BASE/${PROJECT}-ctl +VENV=$BASE/${PROJECT}-venv if [ "$VIRTUAL_ENV" = "" ]; then if which mkvirtualenv >/dev/null 2>&1; then @@ -10,15 +11,15 @@ if [ "$VIRTUAL_ENV" = "" ]; then if [ ! -d $VENV ]; then virtualenv --system-site-packages $VENV 2>/dev/null || virtualenv $VENV fi - . ./$VENV/bin/activate + . $VENV/bin/activate fi fi easy_install -U pip distribute pip install -U django>1.5.0,<1.6 pip install -U -r requirements.txt if [ ! -f $PROJECT.db ]; then - ./$CTL syncdb --all --noinput - ./$CTL migrate --fake - ./load-base-data.sh + $CTL syncdb --all --noinput + $CTL migrate --fake + $BASE/load-base-data.sh fi -./$CTL runserver +$CTL runserver