Skip to content

Commit

Permalink
fix: variable error when bash set -o nounset (rcaloras#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
adoyle-h authored and rcaloras committed Nov 30, 2019
1 parent 290b297 commit f558191
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bash-preexec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ __bp_install_after_session_init() {

# If there's an existing PROMPT_COMMAND capture it and convert it into a function
# So it is preserved and invoked during precmd.
if [[ -n "$PROMPT_COMMAND" ]]; then
if [[ -n "${PROMPT_COMMAND:-}" ]]; then
eval '__bp_original_prompt_command() {
'"$PROMPT_COMMAND"'
}'
Expand All @@ -325,6 +325,6 @@ __bp_install_after_session_init() {
}

# Run our install so long as we're not delaying it.
if [[ -z "$__bp_delay_install" ]]; then
if [[ -z "${__bp_delay_install:-}" ]]; then
__bp_install_after_session_init
fi;

0 comments on commit f558191

Please # to comment.