improve autoenv script

* properly quote DIR variable
  (it might contain spaces)
* use builtin string magic instead of `dirname`
This commit is contained in:
Thomas Kriechbaumer 2015-05-21 13:15:55 +02:00
parent 634f2e2c24
commit b2f87b9424
1 changed files with 3 additions and 3 deletions

6
.env
View File

@ -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