feat: macos and brew install support

This commit is contained in:
Andrejus Kostarevas
2024-01-25 00:27:04 +00:00
parent 62e6c0243e
commit 61fb58e90c
15 changed files with 148 additions and 45 deletions

View File

@@ -1,20 +1,35 @@
#!/usr/bin/env bash
if ! bin_in_path "pyenv"; then
# see https://github.com/pyenv/pyenv/wiki/common-build-problems
pyenv_list_file="$INSTALL_DIR/10-pyenv-pkglist"
install_file "$pyenv_list_file"
# see https://github.com/pyenv/pyenv-installer
download_run \
"https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer" \
bash
# -----------------------------------------------------------------------------
# Description:
# Configure pyenv.
#
if ! bin_in_path "pyenv"; then
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# see https://github.com/pyenv/pyenv/wiki/common-build-problems
pyenv_list_file="$INSTALL_DIR/10-pyenv-pkglist"
install_file "$pyenv_list_file"
# see https://github.com/pyenv/pyenv-installer
download_run \
"https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer" \
bash
e
unset pyenv_list_file
elif [[ "$OSTYPE" == "darwin"* ]]; then
brew install pyenv
brew install pyenv-virtualenv
fi
fi
virtualenv_path="$(pyenv root)/plugins/pyenv-virtualenv"
if [ ! -d "$virtualenv_path" ]; then
git clone \
https://github.com/pyenv/pyenv-virtualenv.git \
$virtualenv_path
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
virtualenv_path="$(pyenv root)/plugins/pyenv-virtualenv"
if [ ! -d "$virtualenv_path" ]; then
git clone \
https://github.com/pyenv/pyenv-virtualenv.git \
$virtualenv_path
fi
fi
eval "$(pyenv init --path)"