Files
easyzsh/install_pyenv.sh
T
Frank Qing 76395923ce fix(install): make setup failures explicit and atomic
Installer pipelines masked dependency and download failures, causing
false success messages and unsafe config replacement.

Atomic updates and current upstream installers keep failures visible.
2026-07-15 00:16:33 +08:00

26 lines
970 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
# Install pyenv (Python Version Manager) if it is not already installed
if command -v pyenv &> /dev/null; then
echo -e "pyenv is already installed\n"
else
echo -e "Installing pyenv (Python Version Manager)\n"
# Using the official pyenv installer (https://github.com/pyenv/pyenv-installer)
curl -fsSL https://pyenv.run | bash
# Load pyenv for the remainder of this script
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init - bash)"
command -v pyenv &> /dev/null
fi
# OPTIONAL: Install the latest stable version of Python
# Uncomment the following line if you would like to automatically install it
# pyenv install 3.12.0 && pyenv global 3.12.0
# Apply the pyenv zsh configuration patch (downloads zshrc/pyenv.zsh to ~/.config/zshrc/pyenv.zsh)
curl -fsSL https://git.miomio.moe/mio/easyzsh/raw/branch/master/patch.sh | bash -s -- pyenv