Skip to content

Commit 9e161bf

Browse files
committed
Merge remote-tracking branch 'smcquay/basename' into doc-tips-update
2 parents b97e1b9 + b42552b commit 9e161bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/source/tips.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ In the ``postmkvirtualenv`` script I have the following to create a
6767
directory based on the project name, add that directory to the python
6868
path and then cd into it::
6969

70-
proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}')
70+
proj_name=$(basename $VIRTUAL_ENV)
7171
mkdir $HOME/projects/$proj_name
7272
add2virtualenv $HOME/projects/$proj_name
7373
cd $HOME/projects/$proj_name
@@ -76,7 +76,7 @@ path and then cd into it::
7676
In the ``postactivate`` script I have it set to automatically change
7777
to the project directory when I use the workon command::
7878

79-
proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}')
79+
proj_name=$(basename $VIRTUAL_ENV)
8080
cd ~/projects/$proj_name
8181

8282
Automatically Run workon When Entering a Directory

0 commit comments

Comments
 (0)