From 070e4eeadf4156b32d00d58b3cef52a58b501aa5 Mon Sep 17 00:00:00 2001 From: Jonathan Dahan Date: Sun, 29 Jan 2012 23:12:25 -0500 Subject: [PATCH] exit if cd into OMZ_HOME fails --- functions/update-omz | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/functions/update-omz b/functions/update-omz index 3ddc1977..61a0b1e9 100644 --- a/functions/update-omz +++ b/functions/update-omz @@ -15,12 +15,12 @@ # # ( [ ! -f ~/.omz-update ] || [ ~/.omz-update(Nmh+6) ] ) && update-omz && touch ~/.omz-update -local current_path=$PWD -cd $OMZ_HOME - zstyle -t ':omz:function:update-omz' auto-commit || local nocommit='--no-commit' zstyle -t ':omz:function:update-omz' upstream '_upstream' +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]" printf 'Hooray! oh-my-zsh is up-to-date :)\n' @@ -29,4 +29,4 @@ else printf 'Oh no! There was an error updating oh-my-zsh :(\n' fi -cd "$current_path" +cd "$current_path" || return 1