Skip to content

Commit

Permalink
set default venv in python projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Adidi committed Sep 26, 2019
1 parent 5a46417 commit f027927
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions zsh/zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,15 @@ if [ -s "$reminder_file" ] ; then
echo "TODO:"
cat "$reminder_file"
fi

function cd() {
if [[ -d ./venv ]] ; then
deactivate
fi

builtin cd $1

if [[ -d ./venv ]] ; then
. ./venv/bin/activate
fi
}

0 comments on commit f027927

Please sign in to comment.