From d984f8d9f8a76e89cdc49c132710857457e7fa8b Mon Sep 17 00:00:00 2001 From: Oluwadara Abijo Date: Fri, 31 Jul 2026 11:32:49 +0100 Subject: [PATCH] fix(ADFA-4959): Fix push error in GUI apps --- .githooks/pre-push/0001-run-spotless | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.githooks/pre-push/0001-run-spotless b/.githooks/pre-push/0001-run-spotless index 0d01d7d443..afabba83e9 100755 --- a/.githooks/pre-push/0001-run-spotless +++ b/.githooks/pre-push/0001-run-spotless @@ -2,9 +2,11 @@ set -e -red=$(tput setaf 1) -green=$(tput setaf 2) -reset=$(tput sgr0) +# Guard tput: GUI git clients (e.g GitHub Desktop) run hooks without TERM, +# where tput exits non-zero and set -e would kill the hook before Spotless runs +red=$(tput setaf 1 2>/dev/null || true) +green=$(tput setaf 2 2>/dev/null || true) +reset=$(tput sgr0 2>/dev/null || true) ##### SPOTLESS HOOK START ##### REPO_ROOT="$(git rev-parse --show-toplevel)"