From e8de7595c2e8a98418593e90b886e45a745e234a Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 1 Sep 2015 02:37:03 +0200 Subject: [PATCH] .env: fix windows compatibility --- .env | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 97f38452b..69ac3f052 100644 --- a/.env +++ b/.env @@ -1,5 +1,6 @@ -DIR="${0%/*}" -if [ -z "$VIRTUAL_ENV" ] && [ -f "$DIR/../venv.mitmproxy/bin/activate" ]; then +DIR="$( dirname "${BASH_SOURCE[0]}" )" +ACTIVATE_DIR="$(if [ -f "$DIR/../venv.mitmproxy/bin/activate" ]; then echo 'bin'; else echo 'Scripts'; fi;)" +if [ -z "$VIRTUAL_ENV" ] && [ -f "$DIR/../venv.mitmproxy/$ACTIVATE_DIR/activate" ]; then echo "Activating mitmproxy virtualenv..." - source "$DIR/../venv.mitmproxy/bin/activate" + source "$DIR/../venv.mitmproxy/$ACTIVATE_DIR/activate" fi