summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-10-06 11:30:00 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-10-06 11:30:00 +0300
commit5bd389e707aff21ef43413e1272965bf375ab197 (patch)
tree91e080ffdf70f7e9d8d34b23b1df4bfd564fbd7d
parent99c9a2ea25aa5da796a96557c1e5238118b4ddb2 (diff)
make __p9k_dump_file readonly to ensure no one unsets it
-rwxr-xr-xpowerlevel9k.zsh-theme4
1 files changed, 2 insertions, 2 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 0c31ba80..7bf59736 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -17,8 +17,7 @@
[[ ! -o 'no_brace_expand' ]] || __p9k_src_opts+=('no_brace_expand')
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
-typeset -g __p9k_root_dir=${POWERLEVEL9K_INSTALLATION_DIR:-${${(%):-%x}:A:h}}
-typeset -g __p9k_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}.zsh
+(( $+__p9k_root_dir )) || typeset -gr __p9k_root_dir=${POWERLEVEL9K_INSTALLATION_DIR:-${${(%):-%x}:A:h}}
() {
emulate -L zsh
@@ -27,6 +26,7 @@ typeset -g __p9k_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}.zsh
prompt_powerlevel9k_setup
return
fi
+ typeset -gr __p9k_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}.zsh
if [[ -z $__p9k_dump_file(.zwc|)(#qNW) ]] && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then
_p9k_preinit
fi