File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -45,11 +45,23 @@ deactivate
45
45
46
46
echo
47
47
echo " LISTING ENVIRONMENTS"
48
- workon
48
+ envs=` workon | tr ' \n' ' ' `
49
+ if [ " $envs " = " env1 env2 " ]
50
+ then
51
+ echo " PASS"
52
+ else
53
+ echo " FAIL: \" " $envs \" " "
54
+ fi
49
55
50
56
echo
51
57
echo " REMOVING ENVIRONMENTS"
52
58
rmvirtualenv " env1"
53
59
rmvirtualenv " env2"
54
60
55
61
rm -rf $WORKON_HOME
62
+
63
+ echo
64
+ echo " MISSING WORKON_HOME"
65
+ workon && echo " Failed to detect missing dir" || echo " PASS"
66
+ mkvirtualenv foo && echo " Failed to detect missing dir" || echo " PASS"
67
+ rmvirtualenv foo && echo " Failed to detect missing dir" || echo " PASS"
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ function virtualenvwrapper_run_hook () {
82
82
#
83
83
function mkvirtualenv () {
84
84
eval "envname=\$$#"
85
- virtualenvwrapper_verify_workon_home
85
+ virtualenvwrapper_verify_workon_home || return 1
86
86
(cd "$WORKON_HOME";
87
87
virtualenv "$@";
88
88
virtualenvwrapper_run_hook "./premkvirtualenv" "$envname"
@@ -94,7 +94,7 @@ function mkvirtualenv () {
94
94
# Remove an environment, in the WORKON_HOME.
95
95
function rmvirtualenv () {
96
96
typeset env_name="$1"
97
- virtualenvwrapper_verify_workon_home
97
+ virtualenvwrapper_verify_workon_home || return 1
98
98
if [ "$env_name" = "" ]
99
99
then
100
100
echo "Please specify an enviroment."
@@ -114,7 +114,7 @@ function rmvirtualenv () {
114
114
115
115
# List the available environments.
116
116
function virtualenvwrapper_show_workon_options () {
117
- virtualenvwrapper_verify_workon_home
117
+ virtualenvwrapper_verify_workon_home || return 1
118
118
find "$WORKON_HOME" -maxdepth 1 -mindepth 1 -type d -exec basename '{}' \; | sort
119
119
}
120
120
You can’t perform that action at this time.
0 commit comments