Skip to content

Commit

Permalink
Add UPDATE_ZSH_DAYS setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Danielson committed Nov 26, 2012
1 parent d750e7d commit 200a258
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions templates/zshrc.zsh-template
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ ZSH_THEME="robbyrussell"
# Comment this out to disable weekly auto-update checks
# 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
# DISABLE_LS_COLORS="true"

Expand Down
8 changes: 7 additions & 1 deletion tools/check_for_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ function _upgrade_zsh() {
_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 ]
then
. ~/.zsh-update
Expand All @@ -23,7 +29,7 @@ then
fi

epoch_diff=$(($(_current_epoch) - $LAST_EPOCH))
if [ $epoch_diff -gt 13 ]
if [ $epoch_diff -gt $epoch_target ]
then
if [ "$DISABLE_UPDATE_PROMPT" = "true" ]
then
Expand Down

0 comments on commit 200a258

Please sign in to comment.