add bash-it

This commit is contained in:
2022-05-05 22:20:02 +02:00
parent 6a62a35d0d
commit 43701f0590
490 changed files with 33047 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
# shellcheck shell=bash
#
# make sure virtualenvwrapper is enabled if available
cite about-plugin
about-plugin 'virtualenvwrapper and pyenv-virtualenvwrapper helper functions'
if _command_exists pyenv; then
pyenv virtualenvwrapper
elif _command_exists virtualenvwrapper.sh; then
source virtualenvwrapper.sh
fi
function mkvenv {
about 'create a new virtualenv for this directory'
group 'virtualenv'
local cwd="${PWD##*/}"
mkvirtualenv --distribute "$cwd"
}
function mkvbranch {
about 'create a new virtualenv for the current branch'
group 'virtualenv'
local cwd="${PWD##*/}"
mkvirtualenv --distribute "${cwd}@${SCM_BRANCH}"
}
function wovbranch {
about 'sets workon branch'
group 'virtualenv'
local cwd="${PWD##*/}"
workon "${cwd}@${SCM_BRANCH}"
}
function wovenv {
about 'works on the virtualenv for this directory'
group 'virtualenv'
workon "${PWD##*/}"
}