From a29b8264e51b402135943ab5a9d8790c8f6cd939 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 1 Aug 2019 20:03:34 +0200 Subject: [PATCH] source .p10k.zsh only if it exists --- internal/wizard.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 8f34fa1d..6d18f2ed 100755 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -949,12 +949,12 @@ function write_zshrc() { local comments=( "# To customize prompt, run \`p10k configure\` or edit $__p9k_cfg_path_u." ) - print -lr -- "" $comments "source $__p9k_cfg_path_u" >>$__p9k_zshrc + print -lr -- "" $comments "[[ -f $__p9k_cfg_path_u ]] && source $__p9k_cfg_path_u" >>$__p9k_zshrc print -P "" print -P "The following lines have been appended to %4F$__p9k_zshrc_u%f:" print -P "" - print -lP -- ' '${^comments} " %2Fsource%f %B$__p9k_cfg_path_u%b" + print -lP -- ' '${^comments} " %3F[[%f %B-f $__p9k_cfg_path_u%b %3F]]%f && %2Fsource%f %B$__p9k_cfg_path_u%b" } if (( force )); then