mirror of
https://github.com/zdharma-continuum/zinit.git
synced 2026-09-10 07:36:38 -04:00
fix(install): restore cwd after the configure hook
∞zinit-configure-base-hook cd'd into the plugin directory inside a plain
{ } block -- not a subshell -- and every one of its four return paths
left the shell parked there. A `zinit update' on a plugin using the
configure ice moved the user's shell and never moved it back.
Wrap the block in an always clause so the directory is restored on all
paths, and use .zinit-cd-quiet instead of a bare `cd --', which was also
firing chpwd hooks and AUTO_PUSHD.
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
This commit is contained in:
parent
712cac1952
commit
d875651d59
|
|
@ -2097,8 +2097,9 @@ zimv() {
|
|||
[[ $eflags == $ex ]] || return 0
|
||||
typeset -aU configure_opt=(${(@s; ;)configure})
|
||||
configure_opt+=("--prefix=${ZPFX:-${ZINIT[HOME_DIR]}/polaris}")
|
||||
local ___oldcd=$PWD ___oldoldpwd=$OLDPWD
|
||||
{
|
||||
builtin cd -- "$dir" || return 1
|
||||
.zinit-cd-quiet "$dir" || return 1
|
||||
if [[ -n *(#i)makefile(#qN) ]]; then
|
||||
return 0
|
||||
elif [[ -z *(#i)configure(#qN) ]]; then
|
||||
|
|
@ -2124,6 +2125,8 @@ zimv() {
|
|||
+zi-log "{e} ${ice} Failed project configuration"
|
||||
return 1
|
||||
fi
|
||||
} always {
|
||||
.zinit-restore-dir "$___oldcd" "$___oldoldpwd"
|
||||
}
|
||||
} # ]]]
|
||||
# FUNCTION: ∞zinit-configure-e-hook [[[
|
||||
|
|
|
|||
Loading…
Reference in a new issue