fix(common): restore output helpers after end_quiet_mode
After end_quiet_mode closes fd 3/4, the overridden warn/error/info functions still reference >&3, causing "bad file descriptor" errors for any calls after quiet mode ends (e.g. the reboot prompt). Restore the original function definitions when leaving quiet mode. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -65,6 +65,15 @@ end_quiet_mode() {
|
||||
exec 1>&3 2>&4
|
||||
exec 3>&- 4>&-
|
||||
echo ""
|
||||
|
||||
# Restore original output helpers (fd 3/4 are closed now)
|
||||
info() { echo -e "${GREEN}[✓]${NC} $1"; }
|
||||
warn() { echo -e "${YELLOW}[!]${NC} $1"; }
|
||||
error() {
|
||||
echo -e "${RED}[✗]${NC} $1"
|
||||
exit 1
|
||||
}
|
||||
step() { echo -e "\n${GREEN}━━━ $1 ━━━${NC}"; }
|
||||
}
|
||||
|
||||
# ── Config backup helper ─────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user