diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2020-02-18 17:47:24 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2020-02-18 17:47:24 +0300 |
commit | d9da275e9e1b4028407488f34db1b9b21f981554 (patch) | |
tree | e41306964bdcbadd47d32baa7a93592820487bb9 /powerlevel10k.zsh-theme | |
parent | e5f2d39a16b704677046547e0facd6f4c3dd1061 (diff) |
more robust zcompile
Diffstat (limited to 'powerlevel10k.zsh-theme')
-rw-r--r-- | powerlevel10k.zsh-theme | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/powerlevel10k.zsh-theme b/powerlevel10k.zsh-theme index 74eaba5a..ee6b38bf 100644 --- a/powerlevel10k.zsh-theme +++ b/powerlevel10k.zsh-theme @@ -44,10 +44,17 @@ _p9k_preinit fi typeset -gr __p9k_sourced=6 - if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus && ${(%):-%#} == % ]]; then + if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus ]]; then local f for f in $__p9k_root_dir/{powerlevel9k.zsh-theme,powerlevel10k.zsh-theme,internal/p10k.zsh,internal/icons.zsh,internal/configure.zsh,internal/worker.zsh,internal/parser.zsh,gitstatus/gitstatus.plugin.zsh}; do - [[ $f.zwc -nt $f ]] || zcompile -R $f + [[ $f.zwc -nt $f ]] && continue + zmodload -F zsh/files b:zf_mv b:zf_rm + local tmp=$f.tmp.$$.zwc + { + zcompile -R -- $tmp $f && zf_mv -f -- $tmp $f.zwc + } always { + (( $? )) && zf_rm -f -- $tmp + } done fi source $__p9k_root_dir/internal/p10k.zsh || true |