Skip to content

Instantly share code, notes, and snippets.

@aleGpereira
Last active February 19, 2019 12:44
Show Gist options
  • Save aleGpereira/4bf94e4ad84817ff7e864fb1c26ff684 to your computer and use it in GitHub Desktop.
Save aleGpereira/4bf94e4ad84817ff7e864fb1c26ff684 to your computer and use it in GitHub Desktop.
VirtualenvWrapper go to project folder postactivate
#!/bin/bash
# This hook should go to $WORKON_HOME/premkvirtualenv
typeset repo_name=${1}
typeset repo_path="path/to/your/${repo_name}"
echo "cd $HOME/$repo_path" >> "$WORKON_HOME/$repo_name/bin/postactivate"
echo "if [ \$? -eq 0 ]; then" >> "$WORKON_HOME/$repo_name/bin/postactivate"
echo " clear" >> "$WORKON_HOME/$repo_name/bin/postactivate"
echo "else" >> "$WORKON_HOME/$repo_name/bin/postactivate"
echo " echo \"No directory found. Is the venv name equal to project name?\"" >> "$WORKON_HOME/$repo_name/bin/postactivate"
echo "fi" >> "$WORKON_HOME/$repo_name/bin/postactivate"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment