mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Avoid invoking hash -r
in fish
It doesn't exist as a builtin, and it doesn't seem there is a way to detect support for a shell builtin that is portable. So, just detect fish and don't the rehash command at all. Fixes #478
This commit is contained in:
parent
44e76bea23
commit
f1fdb9bbc8
2 changed files with 3 additions and 5 deletions
|
@ -15,11 +15,9 @@ rbenv-rehash
|
||||||
|
|
||||||
case "$shell" in
|
case "$shell" in
|
||||||
fish )
|
fish )
|
||||||
or='; or'
|
# no rehash support
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
or='||'
|
echo "hash -r 2>/dev/null || true"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "hash -r 2>/dev/null $or true"
|
|
||||||
|
|
|
@ -109,6 +109,6 @@ SH
|
||||||
@test "sh-rehash in fish" {
|
@test "sh-rehash in fish" {
|
||||||
create_executable "2.0" "ruby"
|
create_executable "2.0" "ruby"
|
||||||
RBENV_SHELL=fish run rbenv-sh-rehash
|
RBENV_SHELL=fish run rbenv-sh-rehash
|
||||||
assert_success "hash -r 2>/dev/null ; or true"
|
assert_success ""
|
||||||
assert [ -x "${RBENV_ROOT}/shims/ruby" ]
|
assert [ -x "${RBENV_ROOT}/shims/ruby" ]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue