1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
prezto/functions/update-omz

35 lines
1.1 KiB

13 years ago
# Update OMZ
# Jonathan Dahan <jonathan@jedahan.com>
13 years ago
# There are two options that can be added to your zshrc
#
13 years ago
# If upstream is a branch other than origin, add
#
13 years ago
# zstyle ':omz:function:update-omz' upstream 'my-upstream-branch'
#
# To automatically commit from upstream, add
#
# zstyle ':omz:function:update-omz' auto-commit 'yes'
#
# If you really need auto-updating and do not care about losing data, try
#
# ( [ ! -f ~/.omz-update ] || [ ~/.omz-update(Nmh+6) ] ) && update-omz && touch ~/.omz-update
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
is-true _color && printf "$FG[blue]"
printf 'Hooray! oh-my-zsh is up-to-date :)\n'
else
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