aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Larson <LucasLarson@riseup.net>2022-05-26 01:48:57 +0300
committerRoman Perepelitsa <roman.perepelitsa@gmail.com>2022-05-26 10:41:45 +0300
commitcf9a1fd02de7c23de102abbf6406ceaabf252a83 (patch)
tree6ed4ee4d77ac20c766376a54a09022ff3d9113a8
parent74ff02a819c5b83b8022c973ce100e41104a41cf (diff)
suppress `nounset` error if `DIRENV_DIR` isn’t defined (fix #1876)
Signed-off-by: Lucas Larson <LucasLarson@riseup.net>
-rw-r--r--internal/p10k.zsh4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 6d3299f1..2ed2aaf9 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -5007,7 +5007,7 @@ _p9k_prompt_proxy_init() {
function prompt_direnv() {
local -i len=$#_p9k__prompt _p9k__has_upglob
- _p9k_prompt_segment $0 $_p9k_color1 yellow DIRENV_ICON 0 '$DIRENV_DIR' ''
+ _p9k_prompt_segment $0 $_p9k_color1 yellow DIRENV_ICON 0 '${DIRENV_DIR:-}' ''
(( _p9k__has_upglob )) || typeset -g "_p9k__segment_val_${_p9k__prompt_side}[_p9k__segment_index]"=$_p9k__prompt[len+1,-1]
}
@@ -5018,7 +5018,7 @@ _p9k_prompt_direnv_init() {
}
function instant_prompt_direnv() {
- if [[ -n $DIRENV_DIR && $precmd_functions[-1] == _p9k_precmd ]]; then
+ if [[ -n ${DIRENV_DIR:-} && $precmd_functions[-1] == _p9k_precmd ]]; then
_p9k_prompt_segment prompt_direnv $_p9k_color1 yellow DIRENV_ICON 0 '' ''
fi
}