Commits

Doug Hellmann  committed 9e161bf Merge

Merge remote-tracking branch 'smcquay/basename' into doc-tips-update

  • Participants
  • Parent commits b97e1b9, b42552b

Comments (0)

Files changed (1)

File docs/source/tips.rst

 directory based on the project name, add that directory to the python
 path and then cd into it::
 
-    proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}')
+    proj_name=$(basename $VIRTUAL_ENV)
     mkdir $HOME/projects/$proj_name
     add2virtualenv $HOME/projects/$proj_name
     cd $HOME/projects/$proj_name
 In the ``postactivate`` script I have it set to automatically change
 to the project directory when I use the workon command::
 
-    proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}')
+    proj_name=$(basename $VIRTUAL_ENV)
     cd ~/projects/$proj_name
 
 Automatically Run workon When Entering a Directory