diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2019-09-06 12:30:11 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2019-09-06 12:30:11 +0300 |
commit | ef6f90f598dcce54b9a96f2aae317a20cab541e9 (patch) | |
tree | f30e0f3e45b90e99b1e65ea93586eb04d4baa8fa /internal/wizard.zsh | |
parent | 072f7be8ff2e3210484956877f066ccd7b157c8c (diff) |
wizard: fix handling for $ZDOTDIR and $HOME with special symbols ("%", "$", etc.)
Diffstat (limited to 'internal/wizard.zsh')
-rwxr-xr-x | internal/wizard.zsh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 56733098..893fa243 100755 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1346,14 +1346,14 @@ function generate_config() { function write_zshrc() { if [[ -e $__p9k_zshrc ]]; then local lines=(${(f)"$(<$__p9k_zshrc)"}) - local f1=$__p9k_cfg_path - local f2=$__p9k_cfg_path_u - local f3=${__p9k_cfg_path_u/#\~\//\$HOME\/} - local f4=${__p9k_cfg_path_u/#\~\//\"\$HOME\"\/} - local f5="'$f1'" - local f6="\"$f1\"" - local f7="\"$f3\"" - if [[ -n ${(@M)lines:#(#b)[^#]#([^[:IDENT:]]|)source[[:space:]]##($f1|$f2|$f3|$f4|$f5|$f6|$f7)*} ]]; then + local f0=$__p9k_cfg_path + local f1=${(q)f0} + local f2=${(q-)f0} + local f3=${(q+)f0} + local f4=${(qq)f0} + local f5=${(qqq)f0} + local g1=${${(q)__p9k_cfg_path}/#(#b)${(q)HOME}\//'~/'} + if [[ -n ${(@M)lines:#(#b)[^#]#([^[:IDENT:]]|)source[[:space:]]##($f1|$f2|$f3|$f4|$f5|$g1)(|[[:space:]]*|'#'*)} ]]; then flowing +c No changes have been made to %4F$__p9k_zshrc_u%f because it already sources %2F$__p9k_cfg_path_u%f. return fi |