aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
diff options
context:
space:
mode:
authorAstounds <kirito@disroot.org>2025-11-05 20:49:57 -0500
committerAstounds <kirito@disroot.org>2025-11-05 20:49:57 -0500
commit0d88c91fc2aa7b53bb49b5022dc02bb1c7cafc5d (patch)
treef766723b9b7f1ba3aec605d0e3ad0025d23bf8fe /install.sh
parent53a8e4044b939d0501a2f448f70f30b1c428f46a (diff)
downloadhyperterm-0d88c91fc2aa7b53bb49b5022dc02bb1c7cafc5d.tar.lz
hyperterm-0d88c91fc2aa7b53bb49b5022dc02bb1c7cafc5d.tar.xz
hyperterm-0d88c91fc2aa7b53bb49b5022dc02bb1c7cafc5d.zip
fix: skip install packages in Git Bash on Windows
Prevents package manager errors when running install script in Git Bash by detecting Windows environment and only checking for essential tools.
Diffstat (limited to 'install.sh')
-rw-r--r--install.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/install.sh b/install.sh
index f2cd43e..d5f447d 100644
--- a/install.sh
+++ b/install.sh
@@ -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")