Skip to content

Commit f1392cf

Browse files
committed
create the WORKON_HOME dir if it doesn't exist.
1 parent 0d2ea2e commit f1392cf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

virtualenvwrapper.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,15 @@ virtualenvwrapper_derive_workon_home() {
9090
return 0
9191
}
9292

93-
# Verify that the WORKON_HOME directory exists
93+
# Check if the WORKON_HOME directory exists,
94+
# create it if it does not
95+
# seperate from creating the files in it because this used to just error
96+
# and maybe other things rely on the dir existing before that happens.
9497
virtualenvwrapper_verify_workon_home () {
9598
if [ ! -d "$WORKON_HOME" ]
9699
then
97-
[ "$1" != "-q" ] && echo "ERROR: Virtual environments directory '$WORKON_HOME' does not exist. Create it or set WORKON_HOME to an existing directory." 1>&2
98-
return 1
100+
[ "$1" != "-q" ] && echo "NOTE: Virtual environments directory '$WORKON_HOME' does not exist. Creating..." 1>&2
101+
mkdir $WORKON_HOME
99102
fi
100103
return 0
101104
}

0 commit comments

Comments
 (0)