Skip to content

Commit

Permalink
chore: redirect stdout and stderr to terminal and file
Browse files Browse the repository at this point in the history
  • Loading branch information
LangLangBart committed May 17, 2024
1 parent faf8ba1 commit b1a1d8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gh-notify
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ if $GH_NOTIFY_DEBUG_MODE; then
# Unset GH_FORCE_TTY to avoid unnecessary color codes in the debug file
unset GH_FORCE_TTY

# Redirect stdout and stderr to the terminal and a file, in fzf 0.52.0+ the UI is no longer
# written to stderr: https://github.com/junegunn/fzf/discussions/3792
exec &> >(tee -a "$gh_notify_debug_log")

# [DISABLED] 'GH_DEBUG' sends the output to file descriptor 2, but these error messages can be
# caught by adding '2>&5' to all gh api calls, but this would also hide the actual error message
# from a failed gh api call. It would be great to have an actual environment variable like
Expand Down

0 comments on commit b1a1d8e

Please sign in to comment.