File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ POST_CHECKOUT_HOOK_URL="https://raw.githubusercontent.com/LucaTools/LucaScripts/
2525# GITHUB API AUTHENTICATION
2626# =============================================================================
2727
28+ trap ' printf "\n❌ Installation interrupted.\n"; exit 130' INT
29+
2830# Build curl options for GitHub API requests.
2931# If GITHUB_TOKEN is set, include it as a Bearer token to avoid rate limiting
3032# (5000 req/hr authenticated vs. 60 req/hr unauthenticated).
@@ -210,6 +212,7 @@ echo "🧹 Cleaned up temporary files"
210212# This checks if the install directory is writable before using sudo
211213sudo_if_install_dir_not_writeable () {
212214 local command=" $1 "
215+ local exit_code
213216 if [ -w " $INSTALL_DIR " ]; then
214217 # Directory is writable, run without sudo
215218 sh -c " $command "
@@ -218,6 +221,11 @@ sudo_if_install_dir_not_writeable() {
218221 echo " 🔐 Administrator privileges required for installation to $INSTALL_DIR "
219222 sudo sh -c " $command "
220223 fi
224+ exit_code=$?
225+ if [ " $exit_code " -ne 0 ]; then
226+ echo " ❌ ERROR: Command failed or was interrupted (exit code: $exit_code )"
227+ exit " $exit_code "
228+ fi
221229}
222230
223231# Create install directory if it doesn't exist
You can’t perform that action at this time.
0 commit comments