mirror of
https://github.com/rbenv/rbenv.git
synced 2025-01-01 06:37:11 +01:00
Get rid of explicit exit in fish branch of rbenv-init
Allows for code to be added to the end of the script which will not mysteriously fail to run for fish shell.
This commit is contained in:
parent
fe0b2436b8
commit
13a474c4e9
2 changed files with 19 additions and 1 deletions
|
@ -140,7 +140,6 @@ function rbenv
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
EOS
|
EOS
|
||||||
exit 0
|
|
||||||
;;
|
;;
|
||||||
ksh )
|
ksh )
|
||||||
cat <<EOS
|
cat <<EOS
|
||||||
|
@ -156,6 +155,7 @@ EOS
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [ "$shell" != "fish" ]; then
|
||||||
IFS="|"
|
IFS="|"
|
||||||
cat <<EOS
|
cat <<EOS
|
||||||
command="\$1"
|
command="\$1"
|
||||||
|
@ -171,3 +171,4 @@ cat <<EOS
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
EOS
|
EOS
|
||||||
|
fi
|
||||||
|
|
|
@ -77,3 +77,20 @@ load test_helper
|
||||||
assert_success
|
assert_success
|
||||||
refute_line 'setenv PATH "'${RBENV_ROOT}'/shims" $PATH ;'
|
refute_line 'setenv PATH "'${RBENV_ROOT}'/shims" $PATH ;'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "outputs sh-compatible syntax" {
|
||||||
|
run rbenv-init - bash
|
||||||
|
assert_success
|
||||||
|
assert_line ' case "$command" in'
|
||||||
|
|
||||||
|
run rbenv-init - zsh
|
||||||
|
assert_success
|
||||||
|
assert_line ' case "$command" in'
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "outputs fish-specific syntax (fish)" {
|
||||||
|
run rbenv-init - fish
|
||||||
|
assert_success
|
||||||
|
assert_line ' switch "$command"'
|
||||||
|
refute_line ' case "$command" in'
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue