Skip to content

Commit

Permalink
fix(templates): add usage message to workon and mkvirtualenv functions
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed Jun 2, 2023
1 parent cfee128 commit 2952c10
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions chezmoi/dot_config/shrc/00-dotfiles-export.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,21 @@ export DOTFILES_PKGS_TO_INSTALL
# Python Virtual Environment
export WORKON_HOME=$HOME/.venvs
function workon {
if [ -z "$1" ]; then
echo "Usage: workon <virtualenv>"
return
fi
if [ -d "$WORKON_HOME/$1" ]; then
source "$WORKON_HOME/$1/bin/activate"
else
echo "No such virtualenv: $1"
fi
}
function mkvirtualenv {
if [ -z "$1" ]; then
echo "Usage: mkvirtualenv <virtualenv>"
return
fi
if [ ! -d "$WORKON_HOME/$1" ]; then
python3 -m venv "$WORKON_HOME/$1"
source "$WORKON_HOME/$1/bin/activate"
Expand Down

0 comments on commit 2952c10

Please sign in to comment.