add POWERLEVEL9K_CONFIG_FILE

pull/644/head
romkatv 5 years ago
parent 3ef4e68b5f
commit ddc47993a2

@ -1498,5 +1498,8 @@
(( ! $+functions[p10k] )) || p10k reload (( ! $+functions[p10k] )) || p10k reload
} }
# Tell `p10k configure` which file it should overwrite.
typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a}
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} (( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
'builtin' 'unset' 'p10k_config_opts' 'builtin' 'unset' 'p10k_config_opts'

@ -1476,5 +1476,8 @@
(( ! $+functions[p10k] )) || p10k reload (( ! $+functions[p10k] )) || p10k reload
} }
# Tell `p10k configure` which file it should overwrite.
typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a}
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} (( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
'builtin' 'unset' 'p10k_config_opts' 'builtin' 'unset' 'p10k_config_opts'

@ -1476,5 +1476,8 @@
(( ! $+functions[p10k] )) || p10k reload (( ! $+functions[p10k] )) || p10k reload
} }
# Tell `p10k configure` which file it should overwrite.
typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a}
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} (( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
'builtin' 'unset' 'p10k_config_opts' 'builtin' 'unset' 'p10k_config_opts'

@ -186,5 +186,8 @@
(( ! $+functions[p10k] )) || p10k reload (( ! $+functions[p10k] )) || p10k reload
} }
# Tell `p10k configure` which file it should overwrite.
typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a}
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} (( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
'builtin' 'unset' 'p10k_config_opts' 'builtin' 'unset' 'p10k_config_opts'

@ -1573,5 +1573,8 @@
(( ! $+functions[p10k] )) || p10k reload (( ! $+functions[p10k] )) || p10k reload
} }
# Tell `p10k configure` which file it should overwrite.
typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a}
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} (( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
'builtin' 'unset' 'p10k_config_opts' 'builtin' 'unset' 'p10k_config_opts'

@ -104,5 +104,8 @@
(( ! $+functions[p10k] )) || p10k reload (( ! $+functions[p10k] )) || p10k reload
} }
# Tell `p10k configure` which file it should overwrite.
typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a}
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} (( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
'builtin' 'unset' 'p10k_config_opts' 'builtin' 'unset' 'p10k_config_opts'

@ -2,10 +2,6 @@ typeset -gr __p9k_wizard_columns=55
typeset -gr __p9k_wizard_lines=21 typeset -gr __p9k_wizard_lines=21
typeset -gr __p9k_zd=${ZDOTDIR:-$HOME} typeset -gr __p9k_zd=${ZDOTDIR:-$HOME}
typeset -gr __p9k_zd_u=${${${(q)__p9k_zd}/#(#b)${(q)HOME}(|\/*)/'~'$match[1]}//\%/%%} typeset -gr __p9k_zd_u=${${${(q)__p9k_zd}/#(#b)${(q)HOME}(|\/*)/'~'$match[1]}//\%/%%}
typeset -gr __p9k_cfg_basename=.p10k.zsh
typeset -gr __p9k_cfg_path_o=$__p9k_zd/$__p9k_cfg_basename
typeset -gr __p9k_cfg_path=${__p9k_cfg_path_o:A}
typeset -gr __p9k_cfg_path_u=$__p9k_zd_u/$__p9k_cfg_basename
typeset -gr __p9k_zshrc=${${:-$__p9k_zd/.zshrc}:A} typeset -gr __p9k_zshrc=${${:-$__p9k_zd/.zshrc}:A}
typeset -gr __p9k_zshrc_u=$__p9k_zd_u/.zshrc 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_root_dir_u=${${${(q)__p9k_root_dir}/#(#b)${(q)HOME}(|\/*)/'~'$match[1]}//\%/%%}
@ -15,6 +11,10 @@ function _p9k_can_configure() {
function $0_error() { function $0_error() {
(( q )) || print -rP "%1F[ERROR]%f %Bp10k configure%b: $1" >&2 (( q )) || print -rP "%1F[ERROR]%f %Bp10k configure%b: $1" >&2
} }
typeset -g __p9k_cfg_path_o=${POWERLEVEL9K_CONFIG_FILE:=${ZDOTDIR:-~}/.p10k.zsh}
typeset -g __p9k_cfg_basename=${__p9k_cfg_path_o:t}
typeset -g __p9k_cfg_path=${__p9k_cfg_path_o:A}
typeset -g __p9k_cfg_path_u=${${${(q)__p9k_cfg_path_o}/#(#b)${(q)HOME}(|\/*)/'~'$match[1]}//\%/%%}
{ {
[[ -o multibyte ]] || { $0_error "multibyte option is not set"; return 1 } [[ -o multibyte ]] || { $0_error "multibyte option is not set"; return 1 }
[[ -e $__p9k_zd ]] || { $0_error "$__p9k_zd_u does not exist"; return 1 } [[ -e $__p9k_zd ]] || { $0_error "$__p9k_zd_u does not exist"; return 1 }
@ -56,6 +56,7 @@ function _p9k_can_configure() {
function p9k_configure() { function p9k_configure() {
eval "$__p9k_intro" eval "$__p9k_intro"
_p9k_can_configure || return
( (
set -- -f set -- -f
source $__p9k_root_dir/internal/wizard.zsh source $__p9k_root_dir/internal/wizard.zsh

Loading…
Cancel
Save