Commits

barberj committed 73d217d

Commiting up to show. Expandpath doesn't seem to return the path unless i put the preceding echo. Then however its malformed.

Trying to get tests/test_derive_workon_home.sh:test_includes_tilde to pass.

Comments (0)

Files changed (1)

virtualenvwrapper.sh

     export VIRTUALENVWRAPPER_PROJECT_FILENAME=".project"
 fi
 
-function expandedpath {
+function expandpath {
         if [ "$1" == "" ]; then
+            echo "Nothing passed"
             return 1
         else
-            "$VIRTUALENVWRAPPER_PYTHON" -c "import os,sys; sys.stdout.write(os.path.realpath(\"$1\")+'\n')"
+            echo
+            "$VIRTUALENVWRAPPER_PYTHON" -c "import os,sys; sys.stdout.write(os.path.realpath(os.path.expandvars(os.path.expanduser(\"$1\")))+'\n')"
             return 0
         fi
 }
         # - 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=$(expandedpath $workon_home_dir)
+        workon_home_dir=$(expandpath $workon_home_dir)
     fi
 
     echo "$workon_home_dir"
             -r)
                 i=$(( $i + 1 ));
                 requirements="${in_args[$i]}";
-                requirements=$(expandedpath $requirements);;
+                requirements=$(expandpath $requirements);;
             *)
                 if [ ${#out_args} -gt 0 ]
                 then
 # adding the hook scripts 
 function importvirtualenv {
     # source path for the virtualenv to import
-    typeset srcvirtualenv=$(expandedpath "$1")
+    typeset srcvirtualenv=$(expandpath "$1")
     # second parameter is optional,
     # its the target environment name
     # incase they want it different