From b4238791aae23a8d533130487418784068816279 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sat, 16 Aug 2025 11:30:48 -0400 Subject: [PATCH] chore: harden installer script --- scripts/install.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index b69d11e..98366ea 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -5,7 +5,9 @@ # Supports installing from a specific branch using the -b or --branch flag. # Example: ./install.sh -b beta -set -e +set -euo pipefail +IFS=$'\n\t' +trap 'echo "[ERROR] Line $LINENO failed"; exit 1' ERR # --- Configuration --- REPO_URL="https://github.com/PR0M3TH3AN/SeedPass.git" @@ -18,10 +20,10 @@ BRANCH="main" # Default branch INSTALL_GUI=false # --- Helper Functions --- -print_info() { echo -e "\033[1;34m[INFO]\033[0m $1"; } -print_success() { echo -e "\033[1;32m[SUCCESS]\033[0m $1"; } -print_warning() { echo -e "\033[1;33m[WARNING]\033[0m $1"; } -print_error() { echo -e "\033[1;31m[ERROR]\033[0m $1" >&2; exit 1; } +print_info() { echo -e "\033[1;34m[INFO]\033[0m" "$1"; } +print_success() { echo -e "\033[1;32m[SUCCESS]\033[0m" "$1"; } +print_warning() { echo -e "\033[1;33m[WARNING]\033[0m" "$1"; } +print_error() { echo -e "\033[1;31m[ERROR]\033[0m" "$1" >&2; exit 1; } # Install build dependencies for Gtk/GObject if available via the system package manager install_dependencies() {