]>
git.rmz.io Git - dotfiles.git/blob - zsh/tools/check_for_upgrade.sh
581f03a07f3a56a84e55b033e4f86c5d8778c39c
3 function _current_epoch
() {
4 echo $(($(date +%s) / 60 / 60 / 24))
7 function _update_zsh_update
() {
8 echo "LAST_EPOCH=$(_current_epoch)" > ~
/.zsh
-update
11 function _upgrade_zsh
() {
12 /usr
/bin
/env ZSH
=$ZSH /bin
/sh
$ZSH/tools
/upgrade.sh
17 epoch_target
=$UPDATE_ZSH_DAYS
18 if [[ -z "$epoch_target" ]]; then
19 # Default to old behavior
23 if [ -f ~
/.zsh
-update ]
27 if [[ -z "$LAST_EPOCH" ]]; then
28 _update_zsh_update
&& return 0;
31 epoch_diff
=$(($(_current_epoch) - $LAST_EPOCH))
32 if [ $epoch_diff -gt $epoch_target ]
34 if [ "$DISABLE_UPDATE_PROMPT" = "true" ]
38 echo "[Oh My Zsh] Would you like to check for updates?"
39 echo "Type Y to update oh-my-zsh: \c"
41 if [ "$line" = Y
] || [ "$line" = y
]; then