Update bootstrap script to handle python installation
This commit is contained in:
@@ -119,6 +119,15 @@ install_requirements() {
|
||||
# =============================================
|
||||
# CORE FUNCTIONS
|
||||
# =============================================
|
||||
|
||||
check_python_installed() {
|
||||
if ! command -v python &> /dev/null; then
|
||||
echo_error "Python is not installed. Please install Python before running this script."
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
initialize_pyenv() {
|
||||
# Set up pyenv environment variables
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
@@ -280,7 +289,12 @@ if [ "$FORCE_PYENV_INSTALL" = true ]; then
|
||||
echo_status "Forcing pyenv reinstallation"
|
||||
fi
|
||||
|
||||
# 1. Check/install pyenv
|
||||
# 1. Check if Python is installed
|
||||
if ! check_python_installed; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
# 2. Check/install pyenv
|
||||
if ! check_and_install_pyenv; then
|
||||
return 1
|
||||
fi
|
||||
@@ -317,5 +331,5 @@ fi
|
||||
echo_status "Bootstrap completed successfully!"
|
||||
echo_status "Virtual environment '$PYENV_NAME' is active"
|
||||
echo_status "Pyenv: $(pyenv version)"
|
||||
echo_status "Python: $(which python) $(python --version)"
|
||||
echo_status "$(python --version) ($(which python))"
|
||||
echo_status "Happy coding!"
|
||||
|
||||
Reference in New Issue
Block a user