File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,15 @@ function virtualenvwrapper_expandpath {
110
110
fi
111
111
}
112
112
113
+ function virtualenvwrapper_absolutepath {
114
+ if [ " $1 " = " " ]; then
115
+ return 1
116
+ else
117
+ " $VIRTUALENVWRAPPER_PYTHON " -c " import os,sys; sys.stdout.write(os.path.abspath(\" $1 \" )+'\n')"
118
+ return 0
119
+ fi
120
+ }
121
+
113
122
function virtualenvwrapper_derive_workon_home {
114
123
typeset workon_home_dir=" $WORKON_HOME "
115
124
@@ -405,7 +414,7 @@ function mkvirtualenv {
405
414
-p|--python)
406
415
i=$(( $i + 1 )) ;
407
416
interpreter=" ${in_args[$i]} " ;
408
- interpreter=$( realpath " $interpreter " ) ;;
417
+ interpreter=$( virtualenvwrapper_absolutepath " $interpreter " ) ;;
409
418
-r)
410
419
i=$(( $i + 1 )) ;
411
420
requirements=" ${in_args[$i]} " ;
@@ -749,7 +758,7 @@ function add2virtualenv {
749
758
750
759
for pydir in " $@ "
751
760
do
752
- absolute_path=$( " $VIRTUALENVWRAPPER_PYTHON " -c " import os,sys; sys.stdout.write(os.path.abspath( \" $pydir \" )+'\n') " )
761
+ absolute_path=$( virtualenvwrapper_absolutepath " $pydir " )
753
762
if [ " $absolute_path " != " $pydir " ]
754
763
then
755
764
echo " Warning: Converting \" $pydir \" to \" $absolute_path \" " 1>&2
You can’t perform that action at this time.
0 commit comments