From cdcdb5c68dd158d4cceccf0c9d8e8afe200d62ee Mon Sep 17 00:00:00 2001 From: acoalson Date: Fri, 23 May 2025 17:29:19 -0700 Subject: [PATCH] Add defensive check for unset PYENV_ROOT in init_dirs --- libexec/pyenv-init | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libexec/pyenv-init b/libexec/pyenv-init index 3892ec65..de7305ca 100755 --- a/libexec/pyenv-init +++ b/libexec/pyenv-init @@ -169,6 +169,11 @@ function help_() { } function init_dirs() { + if [ -z "$PYENV_ROOT" ]; then + echo 'Error: PYENV_ROOT is not set. Aborting.' >&2 + exit 1 + fi + mkdir -p "${PYENV_ROOT}/"{shims,versions} }