summaryrefslogtreecommitdiff
path: root/internal/configure.zsh
diff options
context:
space:
mode:
authorbrettm12345 <brettmandler@gmail.com>2020-02-16 03:51:11 +0300
committerbrettm12345 <brettmandler@gmail.com>2020-02-16 03:51:11 +0300
commitfe27e57de6af93bf8ebc0905c5c926c12e783ed9 (patch)
tree4856089caf4ef18a596872de8153e0920bdc221a /internal/configure.zsh
parent4f7efdcc8b288f61094ea384dfb0faddb46290cf (diff)
Added the `__p9k_readonly_zsh` variable
Diffstat (limited to 'internal/configure.zsh')
-rw-r--r--internal/configure.zsh7
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/configure.zsh b/internal/configure.zsh
index 8a21c639..da20d347 100644
--- a/internal/configure.zsh
+++ b/internal/configure.zsh
@@ -10,6 +10,8 @@ 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_readonly_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() {
@@ -43,10 +45,7 @@ function _p9k_can_configure() {
$0_error "$__p9k_zshrc_u is not readable"
return 1
}
- [[ ! -e $__p9k_zshrc || -w $__p9k_zshrc ]] || {
- $0_error "$__p9k_zshrc_u is not writable"
- return 1
- }
+
(( LINES >= __p9k_wizard_lines && COLUMNS >= __p9k_wizard_columns )) || {
$0_error "terminal size too small; must be at least $__p9k_wizard_columns x $__p9k_wizard_lines"
return 1