From 1a352370a80c966f34be9391d391e39f3ad56bdb Mon Sep 17 00:00:00 2001 From: Alex Povel Date: Tue, 19 Dec 2023 11:16:09 +0100 Subject: [PATCH] fix: `pyenv` initial setup and install Requires pyenv to be loaded properly, else won't be found --- debian.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/debian.sh b/debian.sh index f38743d..b64dfde 100755 --- a/debian.sh +++ b/debian.sh @@ -286,9 +286,20 @@ install_language_toolchains() { curl https://pyenv.run | bash fi - for version in '3.9' '3.10' '3.11' '3.12'; do - pyenv install --skip-existing "$version" - done + ( + # These steps are optional; they just pre-install some versions to save time + # later on. The steps up to `eval` are copied from the docs and might break. + # They are present in `.zshrc` already but we don't have access to that + # here yet. + + export PYENV_ROOT="$HOME/.pyenv" + [[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" + eval "$(pyenv init -)" + + for version in '3.9' '3.10' '3.11' '3.12'; do + pyenv install --skip-existing "$version" + done + ) pipx install pdm