mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-01 04:30:37 +02:00
Merge cb71e4b565 into e46843685c
This commit is contained in:
commit
0889467dc8
1 changed files with 7 additions and 3 deletions
|
|
@ -1,5 +1,9 @@
|
||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
if [ -z "$ZSH_UPDATE" ]; then
|
||||||
|
ZSH_UPDATE="$ZSH/cache/.zsh-update"
|
||||||
|
fi
|
||||||
|
|
||||||
zmodload zsh/datetime
|
zmodload zsh/datetime
|
||||||
|
|
||||||
function _current_epoch() {
|
function _current_epoch() {
|
||||||
|
|
@ -7,7 +11,7 @@ function _current_epoch() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function _update_zsh_update() {
|
function _update_zsh_update() {
|
||||||
echo "LAST_EPOCH=$(_current_epoch)" >! ~/.zsh-update
|
echo "LAST_EPOCH=$(_current_epoch)" >! $ZSH_UPDATE
|
||||||
}
|
}
|
||||||
|
|
||||||
function _upgrade_zsh() {
|
function _upgrade_zsh() {
|
||||||
|
|
@ -29,9 +33,9 @@ fi
|
||||||
# Cancel upgrade if git is unavailable on the system
|
# Cancel upgrade if git is unavailable on the system
|
||||||
whence git >/dev/null || return 0
|
whence git >/dev/null || return 0
|
||||||
|
|
||||||
if [ -f ~/.zsh-update ]
|
if [ -f $ZSH_UPDATE ]
|
||||||
then
|
then
|
||||||
. ~/.zsh-update
|
. $ZSH_UPDATE
|
||||||
|
|
||||||
if [[ -z "$LAST_EPOCH" ]]; then
|
if [[ -z "$LAST_EPOCH" ]]; then
|
||||||
_update_zsh_update && return 0;
|
_update_zsh_update && return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue