Merge pull request #707 from gmcmillan/master
Allow user to disable update prompt
Diff
1diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
2index aeaa0e415f496a7b0d895efe582833bb9f87dc2d..524aa509d5bf5525ecc6b4e5ac3e879e1b5fb98b 100644
3--- a/tools/check_for_upgrade.sh
4+++ b/tools/check_for_upgrade.sh
5@@ -8,6 +8,12 @@ function _update_zsh_update() {
6 echo "LAST_EPOCH=$(_current_epoch)" > ~/.zsh-update
7 }
8 9+function _upgrade_zsh() {
10+ /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
11+ # update the zsh file
12+ _update_zsh_update
13+}
14+
15 if [ -f ~/.zsh-update ]
16 then
17 . ~/.zsh-update
18@@ -19,17 +25,21 @@ then
19 epoch_diff=$(($(_current_epoch) - $LAST_EPOCH))
20 if [ $epoch_diff -gt 6 ]
21 then
22- echo "[Oh My Zsh] Would you like to check for updates?"
23- echo "Type Y to update oh-my-zsh: \c"
24- read line
25- if [ "$line" = Y ] || [ "$line" = y ]
26+ if [ "$DISABLE_UPDATE_PROMPT" = "true" ]
27 then
28- /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
29- # update the zsh file
30- _update_zsh_update
31+ _upgrade_zsh
32+ else
33+ echo "[Oh My Zsh] Would you like to check for updates?"
34+ echo "Type Y to update oh-my-zsh: \c"
35+ read line
36+ if [ "$line" = Y ] || [ "$line" = y ]
37+ then
38+ _upgrade_zsh
39+ fi
40 fi
41 fi
42 else
43 # create the zsh file
44 _update_zsh_update
45 fi
46+