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 {
110110 fi
111111}
112112
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+
113122function virtualenvwrapper_derive_workon_home {
114123 typeset workon_home_dir=" $WORKON_HOME "
115124
@@ -405,7 +414,7 @@ function mkvirtualenv {
405414 -p|--python)
406415 i=$(( $i + 1 )) ;
407416 interpreter=" ${in_args[$i]} " ;
408- interpreter=$( realpath " $interpreter " ) ;;
417+ interpreter=$( virtualenvwrapper_absolutepath " $interpreter " ) ;;
409418 -r)
410419 i=$(( $i + 1 )) ;
411420 requirements=" ${in_args[$i]} " ;
@@ -749,7 +758,7 @@ function add2virtualenv {
749758
750759 for pydir in " $@ "
751760 do
752- absolute_path=$( " $VIRTUALENVWRAPPER_PYTHON " -c " import os,sys; sys.stdout.write(os.path.abspath( \" $pydir \" )+'\n') " )
761+ absolute_path=$( virtualenvwrapper_absolutepath " $pydir " )
753762 if [ " $absolute_path " != " $pydir " ]
754763 then
755764 echo " Warning: Converting \" $pydir \" to \" $absolute_path \" " 1>&2
You can’t perform that action at this time.
0 commit comments