Commits

barberj committed 0fc4fb6

realpath may be reserved so changed to expandedpath.

get the expandedpath of the requirements for cases where people
have updated user scripts causing the directory to change during
execution of workon.

  • Participants
  • Parent commits 890f2fb
  • Branches importvirtualenv

Comments (0)

Files changed (1)

virtualenvwrapper.sh

     export VIRTUALENVWRAPPER_PROJECT_FILENAME=".project"
 fi
 
-function realpath {
+function expandedpath {
         if [ "$1" == "" ]; then
             return 1
         else
         # - Removing extra slashes (e.g., when TMPDIR ends in a slash)
         # - Expanding variables (e.g., $foo)
         # - Converting ~s to complete paths (e.g., ~/ to /home/brian/ and ~arthur to /home/arthur)
-        workon_home_dir=$(realpath $workon_home_dir)
+        workon_home_dir=$(expandedpath $workon_home_dir)
     fi
 
     echo "$workon_home_dir"
                 packages="$packages ${in_args[$i]}";;
             -r)
                 i=$(( $i + 1 ));
-                requirements="${in_args[$i]}";;
+                requirements="${in_args[$i]}";
+                requirements=$(expandedpath $requirements);;
             *)
                 if [ ${#out_args} -gt 0 ]
                 then
 # adding the hook scripts 
 function importvirtualenv {
     # source path for the virtualenv to import
-    typeset srcvirtualenv=$(realpath "$1")
+    typeset srcvirtualenv=$(expandedpath "$1")
     # second parameter is optional,
     # its the target environment name
     # incase they want it different