From 9017e5815cb2b6a0c238d1386620199c49b458a0 Mon Sep 17 00:00:00 2001 From: brettm12345 Date: Sat, 15 Feb 2020 20:10:18 -0500 Subject: [PATCH] Remove the extra variable and inline the test --- internal/configure.zsh | 2 -- internal/wizard.zsh | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/configure.zsh b/internal/configure.zsh index b07aa066..39429f98 100644 --- a/internal/configure.zsh +++ b/internal/configure.zsh @@ -10,8 +10,6 @@ typeset -gr __p9k_zshrc=${${:-$__p9k_zd/.zshrc}:A} typeset -gr __p9k_zshrc_u=$__p9k_zd_u/.zshrc typeset -gr __p9k_root_dir_u=${${${(q)__p9k_root_dir}/#(#b)${(q)HOME}(|\/*)/'~'$match[1]}//\%/%%} -typeset -gr __p9k_writeable_zsh=$(test ! -e $__p9k_zshrc || test -w $__p9k_zshrc) - function _p9k_can_configure() { [[ $1 == '-q' ]] && local -i q=1 || local -i q=0 function $0_error() { diff --git a/internal/wizard.zsh b/internal/wizard.zsh index bcfdadc8..f521e925 100755 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1506,7 +1506,7 @@ function ask_zshrc_edit() { r) return 1;; n) return 0;; y) - [[ $__p9k_writeable_zsh ]] || echo "Zshrc is readonly ignoring..."; return + [[ ! -e $__p9k_zshrc || -w $__p9k_zshrc ]] || echo "Zshrc is readonly ignoring..."; return write_zshrc=1 if [[ -n $zshrc_content ]]; then zshrc_backup="$(mktemp ${TMPDIR:-/tmp}/.zshrc.XXXXXXXXXX)" || quit -c