diff options
Diffstat (limited to 'lib/functions.zsh')
-rw-r--r-- | lib/functions.zsh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/functions.zsh b/lib/functions.zsh index f6f34e851..b0582b32b 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -15,11 +15,17 @@ function upgrade_oh_my_zsh() { # Run update script env ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" + local ret=$? # Update last updated file zmodload zsh/datetime echo "LAST_EPOCH=$(( EPOCHSECONDS / 60 / 60 / 24 ))" >! "${ZSH_CACHE_DIR}/.zsh-update" # Remove update lock if it exists command rm -rf "$ZSH/log/update.lock" + # Restart the zsh session + if [[ $ret -eq 0 ]]; then + # Check whether to run a login shell + [[ "$ZSH_ARGZERO" = -* ]] && exec -l "${ZSH_ARGZERO#-}" || exec "$ZSH_ARGZERO" + fi } function take() { |