Make bash-it reload preserve working directory

In e5b6869 (part of #1283), a regression was introduced, which caused
`bash-it reload` to return with the working directory set to
`.bash_it` and the original working directory discarded.

The root cause is the function wrapper of `bash-it reload`, which has
always relied on the working directory not to change during execution
of the wrapped code. This assumption no longer holds with the changes
introduced in #1283.

This commit fixes the regression by using `pushd`/`popd` in `bash-it
reload`.
This commit is contained in:
Claudia
2019-01-02 17:45:43 +01:00
parent 3b47bc3684
commit 0fe631ea7c

View File

@@ -256,7 +256,7 @@ _bash-it-reload() {
_about 'reloads a profile file'
_group 'lib'
cd "${BASH_IT}" || return
pushd "${BASH_IT}" &> /dev/null || return
case $OSTYPE in
darwin*)
@@ -267,7 +267,7 @@ _bash-it-reload() {
;;
esac
cd - &> /dev/null || return
popd &> /dev/null || return
}
_bash-it-describe ()