From 0bc1d3d96c4a431fb043dfdfe01c66144de6fd1d Mon Sep 17 00:00:00 2001 From: Andrejus Kostarevas Date: Mon, 28 Jun 2021 15:31:52 +0100 Subject: [PATCH] fix: pyenv venv init --- files/home/.config/fish/config.fish | 2 ++ files/home/.profile | 4 ++-- scripts/install.d/10-pyenv.sh | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/files/home/.config/fish/config.fish b/files/home/.config/fish/config.fish index b47f13e..22d499c 100644 --- a/files/home/.config/fish/config.fish +++ b/files/home/.config/fish/config.fish @@ -14,4 +14,6 @@ if status is-interactive replay "source $HOME/.profile" end + pyenv init - | source + end diff --git a/files/home/.profile b/files/home/.profile index 03da756..53b2564 100644 --- a/files/home/.profile +++ b/files/home/.profile @@ -47,8 +47,8 @@ export PATH="$YARN_DIR/bin:$PATH" # pyenv export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" -if [ -d "$PYENV_ROOT" ]; then - [ -x `command -v pyenv` ] && eval "$(pyenv init --path)" +if [ -x `command -v pyenv` ]; then + eval "$(pyenv init --path)" fi # poetry diff --git a/scripts/install.d/10-pyenv.sh b/scripts/install.d/10-pyenv.sh index 25de3be..d14fda1 100755 --- a/scripts/install.d/10-pyenv.sh +++ b/scripts/install.d/10-pyenv.sh @@ -7,6 +7,12 @@ if ! bin_in_path "pyenv"; then # see https://github.com/pyenv/pyenv-installer download_run "https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer" \ bash + +fi + +virtualenv_path="$(pyenv root)/plugins/pyenv-virtualenv" +if [ ! -d "$virtualenv_path" ]; then + git clone https://github.com/pyenv/pyenv-virtualenv.git $virtualenv_path fi eval "$(pyenv init --path)"