Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
e093a4cf
Commit
e093a4cf
authored
Nov 02, 2020
by
Marc Cornellà
Browse files
fix(updater): correctly restart the zsh session when the update pulled changes
parent
889cd7ac
Changes
2
Show whitespace changes
Inline
Side-by-side
lib/cli.zsh
View file @
e093a4cf
...
@@ -352,9 +352,15 @@ function _omz::theme::use {
...
@@ -352,9 +352,15 @@ 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"
env
ZSH
=
"
$ZSH
"
zsh
-f
"
$ZSH
/tools/upgrade.sh"
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
if
[[
$ret
-eq
0
]]
;
then
# Check whether to run a login shell
[[
"
$ZSH_ARGZERO
"
=
-
*
]]
&&
exec
-l
"
${
ZSH_ARGZERO
#-
}
"
||
exec
"
$ZSH_ARGZERO
"
fi
}
}
lib/functions.zsh
View file @
e093a4cf
...
@@ -15,11 +15,17 @@ function upgrade_oh_my_zsh() {
...
@@ -15,11 +15,17 @@ function upgrade_oh_my_zsh() {
# Run update script
# Run update script
env
ZSH
=
"
$ZSH
"
zsh
-f
"
$ZSH
/tools/upgrade.sh"
env
ZSH
=
"
$ZSH
"
zsh
-f
"
$ZSH
/tools/upgrade.sh"
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
if
[[
$ret
-eq
0
]]
;
then
# Check whether to run a login shell
[[
"
$ZSH_ARGZERO
"
=
-
*
]]
&&
exec
-l
"
${
ZSH_ARGZERO
#-
}
"
||
exec
"
$ZSH_ARGZERO
"
fi
}
}
function
take
()
{
function
take
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment