mirror of
https://github.com/rbenv/rbenv.git
synced 2025-01-01 06:37:11 +01:00
Merge pull request #1099 from blueyed/init-shell
Improve init: warn about missing shell and use it in the template
This commit is contained in:
commit
585ed84283
2 changed files with 9 additions and 3 deletions
|
@ -71,10 +71,10 @@ if [ -z "$print" ]; then
|
||||||
echo
|
echo
|
||||||
case "$shell" in
|
case "$shell" in
|
||||||
fish )
|
fish )
|
||||||
echo 'status --is-interactive; and rbenv init - | source'
|
echo 'status --is-interactive; and rbenv init - fish | source'
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
echo 'eval "$(rbenv init -)"'
|
printf 'eval "$(rbenv init - %s)"\n' "$shell"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
echo
|
echo
|
||||||
|
|
|
@ -51,10 +51,16 @@ OUT
|
||||||
[ -z "$line" ] || flunk "did not expect line: $line"
|
[ -z "$line" ] || flunk "did not expect line: $line"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "posix shell instructions" {
|
||||||
|
run rbenv-init bash
|
||||||
|
assert [ "$status" -eq 1 ]
|
||||||
|
assert_line 'eval "$(rbenv init - bash)"'
|
||||||
|
}
|
||||||
|
|
||||||
@test "fish instructions" {
|
@test "fish instructions" {
|
||||||
run rbenv-init fish
|
run rbenv-init fish
|
||||||
assert [ "$status" -eq 1 ]
|
assert [ "$status" -eq 1 ]
|
||||||
assert_line 'status --is-interactive; and rbenv init - | source'
|
assert_line 'status --is-interactive; and rbenv init - fish | source'
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "option to skip rehash" {
|
@test "option to skip rehash" {
|
||||||
|
|
Loading…
Reference in a new issue