mirror of
https://git.decapod.one/brethil/dotfiles
synced 2024-11-24 12:31:31 +01:00
zsh functions: add -s flag to mkvenv
This commit is contained in:
parent
dff98b066f
commit
f3bf033fb8
|
@ -2,15 +2,20 @@ mkvenv(){
|
||||||
local source_venv
|
local source_venv
|
||||||
if [[ $1 == "-s" ]]; then
|
if [[ $1 == "-s" ]]; then
|
||||||
source_venv=y
|
source_venv=y
|
||||||
|
shift
|
||||||
fi
|
fi
|
||||||
# any arguments are passed on to the `venv` module as flags/arguments
|
# any arguments are passed on to the `venv` module as flags/arguments
|
||||||
if [[ -e .venv ]]; then
|
if [[ -e .venv ]]; then
|
||||||
echo "$(color $RED Error:) $(color $BOLD .venv) already exists." >&2
|
echo "$(color $RED Error:) $(color $BOLD .venv) already exists." >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
echo -n "Creating venv..." && python -m venv $@ .venv && echo -n " done. Enable? [Y/n]"
|
|
||||||
|
echo -n "Creating venv..." && python -m venv $@ .venv
|
||||||
if [[ -z ${source_venv} ]]; then
|
if [[ -z ${source_venv} ]]; then
|
||||||
|
echo -n " done. Enable? [Y/n]"
|
||||||
read source_venv
|
read source_venv
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $source_venv != "n" ]]; then
|
if [[ $source_venv != "n" ]]; then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user