forked from hugoren/logviewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathve
More file actions
executable file
·42 lines (36 loc) · 727 Bytes
/
ve
File metadata and controls
executable file
·42 lines (36 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
if [[ $# -le 0 ]]; then
echo "Usage: `basename $0` <command> [agrument]..."
fi
if [ -r "$HOME/.verc" ]; then
source "$HOME/.verc"
fi
if [ -z "$VIRTUALENV_DIR" ]; then
VIRTUALENV_DIR=".virtualenv"
fi
DIR=`pwd`
for (( ;; ))
do
if [ -r "$DIR/$VIRTUALENV_DIR/bin/activate" ]; then
source "$DIR/$VIRTUALENV_DIR/bin/activate"
if [ -n "$VIRTUAL_ENV" ]; then
break
fi
fi
if [ "$DIR" == "/" ]; then
break
fi
DIR=`dirname $DIR`
done
if [ -z "$VIRTUAL_ENV" ]; then
echo "virtualenv: not found"
echo
exit 1
else
if [ "$1" == "-v" ]; then
echo "virtualenv: $VIRTUAL_ENV"
echo
shift
fi
exec "$@"
fi