This commit is contained in:
Alexandr Kozlinskiy 2018-06-15 21:22:13 +00:00 committed by GitHub
commit d9d25da0cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,7 @@
#!/usr/bin/env zsh
ZSH_UPDATE="$ZSH/cache/.zsh-update"
zmodload zsh/datetime
function _current_epoch() {
@ -7,7 +9,7 @@ function _current_epoch() {
}
function _update_zsh_update() {
echo "LAST_EPOCH=$(_current_epoch)" >! ~/.zsh-update
echo "LAST_EPOCH=$(_current_epoch)" >! "$ZSH_UPDATE"
}
function _upgrade_zsh() {
@ -30,8 +32,8 @@ fi
whence git >/dev/null || return 0
if mkdir "$ZSH/log/update.lock" 2>/dev/null; then
if [ -f ~/.zsh-update ]; then
. ~/.zsh-update
if [ -f "$ZSH_UPDATE" ]; then
. "$ZSH_UPDATE"
if [[ -z "$LAST_EPOCH" ]]; then
_update_zsh_update && return 0;