Fix myriad bugs in playbooks

Update inventory
This commit is contained in:
2018-12-22 13:55:36 -05:00
parent fd77dbfca4
commit 9a35e992d0
12 changed files with 99 additions and 118 deletions

View File

@@ -14,66 +14,3 @@ parse_git_branch() {
}
export PS1="\[\e[0;97m\]\[\e[37m\]\u\[\e[1;94m\]@\[\e[94m\]\h\[\e[0;33m\]$(parse_git_branch) \[\e[37m\]\w\[\e[33m\] \[\e[0;97m\]$\[\e[0m\] "
function venv() {
DIR="/home/$USER/.virtualenvs"
[[ -d $DIR ]] || mkdir $DIR
if [ ! -v $1 ] || [ $1 -eq '--help' ] || [ $1 -eq '-h' ]; then
echo "Custom python Virtualenv manager
\"Because pipenv is too hard and everything else sucks\"
Commands:
list List available virtualenvs
show Alias of list
delete <venv> Delete a virtualenv
del Alias of delete
rm Alias of delete
load <venv> Activate a virtualenv for usage
new <venv> <python> Create a new virtualenv. If <python> is not specified,
then the system default python is used
"
elif [ ! -v $1 ] || [ $1 -eq "list" ] || [ $1 -eq "show" ]; then
echo "hello"
ls $DIR
elif [ $1 -eq "del" ] || [ $1 -eq "rm" ]; then
if [ ! -v $2 ]; then
echo "Error: virtualenv name parameter not provided"
else
if [ ! -d "$DIR/$2" ]; then
echo "Error: virtualenv $2 does not exist"
else
rm -rf $DIR/$2
fi
fi
elif [ $1 -eq "new" ]; then
if [ ! -v $2 ]; then
echo "Error: virtualenv name parameter not provided"
else
if [ -d "$DIR/$2" ]; then
echo "Error: virtualenv $2 already exits"
elif [ -v $3 ]; then
virtualenv $2 --python=$3
else
virtualenv $2
fi
fi
elif [ $1 -eq "load" ]; then
if [ ! -v $2 ]; then
echo "Error: virtualenv name parameter not provided"
elif [ ! -d "$DIR/$2" ]; then
echo "Error: virtualenv $2 does not exist"
else
source $DIR/$2/bin/activate
fi
else
echo "No parameter provided"
fi
}