3a3973284534c318e2cb987a0db1121302d04e10

Author
Moinak Ghosh <moinakg@gmail.com>
Committer
Moinak Ghosh <moinakg@gmail.com>
Date

Message

Change to epoch target in days instead of seconds.

Diff

 1diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
 2index f49bb151f8f504567d6d32867271e30124a8079f..a8ba4820cc2dbfb05bc52235548b89c08cfc3c1d 100644
 3--- a/tools/check_for_upgrade.sh
 4+++ b/tools/check_for_upgrade.sh
 5@@ -3,7 +3,7 @@
 6 zmodload zsh/datetime
 7 
 8 function _current_epoch() {
 9-  echo $EPOCHSECONDS
10+  echo $(( $EPOCHSECONDS / 60 / 60 / 24 ))
11 }
12 
13 function _update_zsh_update() {
14@@ -22,8 +22,6 @@ if [[ -z "$epoch_target" ]]; then
15   epoch_target=13
16 fi
17 
18-epoch_target_seconds=$((epoch_target * 86400))
19-
20 [ -f ~/.profile ] && source ~/.profile
21 
22 # Cancel upgrade if the current user doesn't have write permissions for the
23@@ -39,7 +37,7 @@ then
24   fi
25 
26   epoch_diff=$(($(_current_epoch) - $LAST_EPOCH))
27-  if [ $epoch_diff -gt $epoch_target_seconds ]
28+  if [ $epoch_diff -gt $epoch_target ]
29   then
30     if [ "$DISABLE_UPDATE_PROMPT" = "true" ]
31     then