prezto/functions/update-omz

25 lines
786 B
Text
Raw Normal View History

2012-01-27 04:34:00 -05:00
# Update OMZ
# Jonathan Dahan <jonathan@jedahan.com>
# To auto-commit changes from upstream without review (dangerous!), add to your zshrc:
#
# zstyle ':omz:function:update-omz' auto-commit 'yes'
#
# This will still favor local changes when there are conflicts
current_path=$PWD
2012-01-27 04:37:45 -05:00
cd $OMZ_HOME
zstyle -t ':omz:function:update-omz' auto-commit || local nocommit='--no-commit'
2012-01-27 04:37:04 -05:00
zstyle -t ':omz:function:update-omz' upstream '_upstream'
2012-01-27 04:37:04 -05:00
if git pull $nocommit --strategy=recursive -X ours ${_upstream:-origin} master; then
zstyle -t ':omz:function:update-omz' color && printf "$FG[blue]"
printf 'Hooray! oh-my-zsh is up-to-date :)'
else
zstyle -t ':omz:function:update-omz' color && printf "$FG[red]"
printf 'Oh no! There was an error updating oh-my-zsh :('
fi
cd "$current_path"