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`.
pull/1300/head
Claudia 2019-01-02 17:45:43 +01:00
parent 3b47bc3684
commit 0fe631ea7c
No known key found for this signature in database
GPG Key ID: 246AC3C0F10BE51F
1 changed files with 2 additions and 2 deletions

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 ()