Commit e093a4cf authored by Marc Cornellà's avatar Marc Cornellà
Browse files

fix(updater): correctly restart the zsh session when the update pulled changes

parent 889cd7ac
......@@ -352,9 +352,15 @@ function _omz::theme::use {
function _omz::update {
# 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
}
......@@ -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() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment