From 49a88c66d5dc249e13bb8947d2b2963e83006410 Mon Sep 17 00:00:00 2001 From: Jonathan Dahan Date: Sun, 29 Jan 2012 23:14:00 -0500 Subject: [PATCH] load omz:function:color to a local variable --- functions/update-omz | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/functions/update-omz b/functions/update-omz index 61a0b1e9..36aa0290 100644 --- a/functions/update-omz +++ b/functions/update-omz @@ -17,16 +17,18 @@ zstyle -t ':omz:function:update-omz' auto-commit || local nocommit='--no-commit' zstyle -t ':omz:function:update-omz' upstream '_upstream' +zstyle -t ':omz:function:update-omz' color '_color' local current_path=$PWD cd $OMZ_HOME || return 1 if git pull --rebase $nocommit --strategy=recursive -X ours ${_upstream:-origin} master && git submodule update --recursive; then - zstyle -t ':omz:function:update-omz' color && printf "$FG[blue]" + is-true _color && printf "$FG[blue]" printf 'Hooray! oh-my-zsh is up-to-date :)\n' else - zstyle -t ':omz:function:update-omz' color && printf "$FG[red]" + is-true _color && printf "$FG[red]" printf 'Oh no! There was an error updating oh-my-zsh :(\n' fi +unset _color cd "$current_path" || return 1