mirror of
https://github.com/zdharma-continuum/zinit.git
synced 2026-09-10 07:36:38 -04:00
fix(install): restore cwd on early atclone return
atclone evals inline, unlike the atpull hooks, which go through .zinit-at-eval and get a function frame that absorbs a return from the ice body. Wrap the eval so the restore runs on every path. Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
This commit is contained in:
parent
ed80701426
commit
736403cb39
|
|
@ -2265,10 +2265,14 @@ __zinit-cmake-base-hook () {
|
|||
|
||||
(( ${+ICE[nocd]} == 0 )) && .zinit-cd-quiet "$dir"
|
||||
|
||||
eval "$atclone"
|
||||
rc="$?"
|
||||
|
||||
.zinit-restore-dir "$___oldcd" "$___oldoldpwd"
|
||||
# Unlike its atpull siblings this evals inline, with no .zinit-at-eval
|
||||
# frame to absorb a `return' from the ice body.
|
||||
{
|
||||
eval "$atclone"
|
||||
rc="$?"
|
||||
} always {
|
||||
.zinit-restore-dir "$___oldcd" "$___oldoldpwd"
|
||||
}
|
||||
}
|
||||
|
||||
return "$rc"
|
||||
|
|
|
|||
Loading…
Reference in a new issue