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:
Vladislav Doster 2026-08-27 03:18:26 -05:00
parent ed80701426
commit 736403cb39

View file

@ -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"