Merge pull request #1430 from danielsoneg/egd-update_frequency

Add UPDATE_ZSH_DAYS setting
This commit is contained in:
Robby Russell 2012-11-30 05:47:32 -08:00
commit 533a281919
2 changed files with 10 additions and 1 deletions

View File

@ -17,6 +17,9 @@ ZSH_THEME="robbyrussell"
# Comment this out to disable weekly auto-update checks # Comment this out to disable weekly auto-update checks
# DISABLE_AUTO_UPDATE="true" # DISABLE_AUTO_UPDATE="true"
# Change this value to set how frequently ZSH updates¬
export UPDATE_ZSH_DAYS=13
# Uncomment following line if you want to disable colors in ls # Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true" # DISABLE_LS_COLORS="true"

View File

@ -14,6 +14,12 @@ function _upgrade_zsh() {
_update_zsh_update _update_zsh_update
} }
epoch_target=$UPDATE_ZSH_DAYS
if [[ -z "$epoch_target" ]]; then
# Default to old behavior
epoch_target=13
fi
if [ -f ~/.zsh-update ] if [ -f ~/.zsh-update ]
then then
. ~/.zsh-update . ~/.zsh-update
@ -23,7 +29,7 @@ then
fi fi
epoch_diff=$(($(_current_epoch) - $LAST_EPOCH)) epoch_diff=$(($(_current_epoch) - $LAST_EPOCH))
if [ $epoch_diff -gt 13 ] if [ $epoch_diff -gt $epoch_target ]
then then
if [ "$DISABLE_UPDATE_PROMPT" = "true" ] if [ "$DISABLE_UPDATE_PROMPT" = "true" ]
then then