diff options
| -rw-r--r-- | install.sh | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -37,6 +37,21 @@ function get_os_id() { } # ------------------------- +# Detect Git Bash/Windows +# ------------------------- +function is_git_bash_windows() { + # Check if running in Git Bash on Windows + if [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "cygwin" ]] || [[ -n "$MSYSTEM" ]]; then + return 0 # true + fi + # Additional check for Windows environment + if [[ -n "$WINDIR" ]] || [[ -n "$SYSTEMROOT" ]]; then + return 0 # true + fi + return 1 # false +} + +# ------------------------- # Map programs to packages # ------------------------- function map_program_to_package() { @@ -108,6 +123,31 @@ function install_package() { # Check and install programs # --------------------------- function check_and_install_programs() { + # Skip package installation if running in Git Bash on Windows + if is_git_bash_windows; then + msg "Detectado Git Bash en Windows - omitiendo instalación de paquetes del sistema" \ + "Detected Git Bash on Windows - skipping system package installation" + + # Check if essential programs are available + local missing_programs=() + local programs=("curl" "unzip") + + for prog in "${programs[@]}"; do + if ! command -v "$prog" &>/dev/null; then + missing_programs+=("$prog") + fi + done + + if [[ ${#missing_programs[@]} -gt 0 ]]; then + msg_err "Programas requeridos no encontrados: ${missing_programs[*]}" \ + "Required programs not found: ${missing_programs[*]}" + msg_err "Por favor instala Git for Windows completo que incluye estos programas." \ + "Please install complete Git for Windows which includes these programs." + exit 1 + fi + return 0 + fi + local os_id os_id=$(get_os_id) local programs=("curl" "less" "ls" "iproute2" "unzip") |
