summaryrefslogtreecommitdiff
path: root/tools/check_for_upgrade.sh
diff options
context:
space:
mode:
authorfred-o <fredrik.appelberg@gmail.com>2012-01-16 09:58:03 +0100
committerfred-o <fredrik.appelberg@gmail.com>2012-01-16 09:58:03 +0100
commitf5041025844a2509f42e0bb19cb8d5418340e10c (patch)
treed810a157291582707ef3c41e934830c4138fccb4 /tools/check_for_upgrade.sh
parente24230cbfb766320fa13fcda6c1adb60028288f4 (diff)
parent7a41498b0d4f68c537d494b5f849913361315fde (diff)
downloadzsh-f5041025844a2509f42e0bb19cb8d5418340e10c.tar.gz
zsh-f5041025844a2509f42e0bb19cb8d5418340e10c.tar.bz2
zsh-f5041025844a2509f42e0bb19cb8d5418340e10c.zip
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'tools/check_for_upgrade.sh')
-rw-r--r--tools/check_for_upgrade.sh24
1 files changed, 17 insertions, 7 deletions
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index aeaa0e415..524aa509d 100644
--- a/tools/check_for_upgrade.sh
+++ b/tools/check_for_upgrade.sh
@@ -8,6 +8,12 @@ function _update_zsh_update() {
echo "LAST_EPOCH=$(_current_epoch)" > ~/.zsh-update
}
+function _upgrade_zsh() {
+ /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
+ # update the zsh file
+ _update_zsh_update
+}
+
if [ -f ~/.zsh-update ]
then
. ~/.zsh-update
@@ -19,17 +25,21 @@ then
epoch_diff=$(($(_current_epoch) - $LAST_EPOCH))
if [ $epoch_diff -gt 6 ]
then
- echo "[Oh My Zsh] Would you like to check for updates?"
- echo "Type Y to update oh-my-zsh: \c"
- read line
- if [ "$line" = Y ] || [ "$line" = y ]
+ if [ "$DISABLE_UPDATE_PROMPT" = "true" ]
then
- /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
- # update the zsh file
- _update_zsh_update
+ _upgrade_zsh
+ else
+ echo "[Oh My Zsh] Would you like to check for updates?"
+ echo "Type Y to update oh-my-zsh: \c"
+ read line
+ if [ "$line" = Y ] || [ "$line" = y ]
+ then
+ _upgrade_zsh
+ fi
fi
fi
else
# create the zsh file
_update_zsh_update
fi
+