diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2020-04-07 09:21:33 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2020-04-07 09:21:33 +0300 |
commit | e1323716fe71a5da70b97aa06bcf229bbaaa86a5 (patch) | |
tree | 3299c5888cf2fe288d40d46bb1eab5b31f91290f /powerlevel10k.zsh-theme | |
parent | da58ccbbafe484ff9142f6b4c8e3751dc5cd242b (diff) |
zf_rm before zf_mv to work around NTFS bugs (see #610)
Diffstat (limited to 'powerlevel10k.zsh-theme')
-rw-r--r-- | powerlevel10k.zsh-theme | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/powerlevel10k.zsh-theme b/powerlevel10k.zsh-theme index d1fbd95e..d8a30ba0 100644 --- a/powerlevel10k.zsh-theme +++ b/powerlevel10k.zsh-theme @@ -54,7 +54,7 @@ function _p9k_init_locale() { if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file ]] && (( ! $+functions[_p9k_preinit] )) && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then _p9k_preinit fi - typeset -gr __p9k_sourced=9 + typeset -gr __p9k_sourced=10 if [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]]; then if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus ]]; then local f @@ -63,16 +63,10 @@ function _p9k_init_locale() { zmodload -F zsh/files b:zf_mv b:zf_rm local tmp=$f.tmp.$$.zwc { - # The first error suppression is a workaround for the bug in - # https://aur.archlinux.org/packages/zsh-theme-powerlevel10k-git/. - # This package misses some source files. - # - # The second error suppression is due to - # https://github.com/romkatv/powerlevel10k/issues/610. - # I've no idea what actually happens there. - zcompile -R -- $tmp $f 2>/dev/null && zf_mv -f -- $tmp $f.zwc 2>/dev/null + # `zf_mv -f src dst` fails on NTFS if `dst` is not writable, hence `zf_rm`. + zf_rm -f -- $f.zwc && zcompile -R -- $tmp $f && zf_mv -f -- $tmp $f.zwc } always { - (( $? )) && zf_rm -f -- $tmp 2>/dev/null + (( $? )) && zf_rm -f -- $tmp } done fi |