|
@@ -376,13 +376,19 @@ function _omz::theme::use {
|
|
|
|
|
|
function _omz::update {
|
|
function _omz::update {
|
|
# Run update script
|
|
# Run update script
|
|
- env ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh"
|
|
|
|
|
|
+ if [[ "$1" != --unattended ]]; then
|
|
|
|
+ ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" --interactive
|
|
|
|
+ else
|
|
|
|
+ ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh"
|
|
|
|
+ fi
|
|
local ret=$?
|
|
local ret=$?
|
|
|
|
+
|
|
# Update last updated file
|
|
# Update last updated file
|
|
zmodload zsh/datetime
|
|
zmodload zsh/datetime
|
|
echo "LAST_EPOCH=$(( EPOCHSECONDS / 60 / 60 / 24 ))" >! "${ZSH_CACHE_DIR}/.zsh-update"
|
|
echo "LAST_EPOCH=$(( EPOCHSECONDS / 60 / 60 / 24 ))" >! "${ZSH_CACHE_DIR}/.zsh-update"
|
|
# Remove update lock if it exists
|
|
# Remove update lock if it exists
|
|
command rm -rf "$ZSH/log/update.lock"
|
|
command rm -rf "$ZSH/log/update.lock"
|
|
|
|
+
|
|
# Restart the zsh session
|
|
# Restart the zsh session
|
|
if [[ $ret -eq 0 && "$1" != --unattended ]]; then
|
|
if [[ $ret -eq 0 && "$1" != --unattended ]]; then
|
|
# Check whether to run a login shell
|
|
# Check whether to run a login shell
|