Skip to content

Commit ee7180f

Browse files
committed
fix(installer): silence gum skip notice in non-interactive runs
1 parent 5ca5496 commit ee7180f

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

public/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ print_gum_status() {
222222
ui_success "gum bootstrapped (${GUM_REASON}, v${GUM_VERSION})"
223223
;;
224224
*)
225-
if [[ -n "$GUM_REASON" ]]; then
225+
if [[ -n "$GUM_REASON" && "$GUM_REASON" != "non-interactive shell (auto-disabled)" ]]; then
226226
ui_info "gum skipped (${GUM_REASON})"
227227
fi
228228
;;

scripts/test-install-sh-unit.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,30 @@ echo "==> case: bootstrap_gum_temp (auto disable in non-interactive shell)"
312312
assert_eq "$GUM_REASON" "non-interactive shell (auto-disabled)" "bootstrap_gum_temp non-interactive reason"
313313
)
314314

315+
echo "==> case: print_gum_status (non-interactive skip is silent)"
316+
(
317+
# shellcheck disable=SC2034
318+
GUM_STATUS="skipped"
319+
# shellcheck disable=SC2034
320+
GUM_REASON="non-interactive shell (auto-disabled)"
321+
ui_info() { echo "INFO: $*"; }
322+
323+
out="$(print_gum_status 2>&1 || true)"
324+
assert_eq "$out" "" "print_gum_status non-interactive skip output"
325+
)
326+
327+
echo "==> case: print_gum_status (other skip reasons still print)"
328+
(
329+
# shellcheck disable=SC2034
330+
GUM_STATUS="skipped"
331+
# shellcheck disable=SC2034
332+
GUM_REASON="tar not found"
333+
ui_info() { echo "INFO: $*"; }
334+
335+
out="$(print_gum_status 2>&1 || true)"
336+
assert_contains "$out" "gum skipped (tar not found)" "print_gum_status non-silent reason"
337+
)
338+
315339
echo "==> case: ensure_macos_node22_active (prefers Homebrew node@22 bin)"
316340
(
317341
root="${TMP_DIR}/case-node22-path-fix"

0 commit comments

Comments
 (0)