Skip to content

Commit f558191

Browse files
adoyle-hrcaloras
authored andcommitted
fix: variable error when bash set -o nounset (#101)
1 parent 290b297 commit f558191

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bash-preexec.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ __bp_install_after_session_init() {
309309

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

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

0 commit comments

Comments
 (0)