Skip to content

Commit 4ce11e7

Browse files
Nishikar SapkotaNishikar Sapkota
authored andcommitted
moved environment exists check below active environment check.
1 parent e8b61a5 commit 4ce11e7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

virtualenvwrapper.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,16 +513,17 @@ function rmvirtualenv {
513513
do
514514
echo "Removing $env_name..."
515515
typeset env_dir="$WORKON_HOME/$env_name"
516-
if [ ! -d "$env_dir" ]; then
517-
echo "Cannot remove '$env_name'. No such environment." >&2
518-
fi
519516
if [ "$VIRTUAL_ENV" = "$env_dir" ]
520517
then
521518
echo "ERROR: You cannot remove the active environment ('$env_name')." >&2
522519
echo "Either switch to another environment, or run 'deactivate'." >&2
523520
return 1
524521
fi
525522

523+
if [ ! -d "$env_dir" ]; then
524+
echo "Cannot remove '$env_name'. No such environment." >&2
525+
fi
526+
526527
# Move out of the current directory to one known to be
527528
# safe, in case we are inside the environment somewhere.
528529
typeset prior_dir="$(pwd)"

0 commit comments

Comments
 (0)