From b2f87b9424f825874732c160de109d4385ae59e5 Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Thu, 21 May 2015 13:15:55 +0200 Subject: [PATCH] improve autoenv script * properly quote DIR variable (it might contain spaces) * use builtin string magic instead of `dirname` --- .env | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 7f847e29f..97f38452b 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ -DIR=`dirname $0` -if [ -z "$VIRTUAL_ENV" ] && [ -f $DIR/../venv.mitmproxy/bin/activate ]; then +DIR="${0%/*}" +if [ -z "$VIRTUAL_ENV" ] && [ -f "$DIR/../venv.mitmproxy/bin/activate" ]; then echo "Activating mitmproxy virtualenv..." - source $DIR/../venv.mitmproxy/bin/activate + source "$DIR/../venv.mitmproxy/bin/activate" fi