From b81f0a2c42fddeedf50a2b50aa3f84e73a9ce86c Mon Sep 17 00:00:00 2001 From: Donald Merand Date: Wed, 17 Feb 2016 15:48:00 -0500 Subject: [PATCH 1/2] Fish shell "." is deprecated in favor of "source" Per [the fish documentation for "source"](file:///usr/local/Cellar/fish/2.2.0/share/doc/fish/commands.html#source) - ". (a single period) is an alias for the source command. The use of . is deprecated in favour of source, and . will be removed in a future version of fish." --- libexec/rbenv-init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rbenv-init b/libexec/rbenv-init index 7ddae5e5..82df3229 100755 --- a/libexec/rbenv-init +++ b/libexec/rbenv-init @@ -70,7 +70,7 @@ if [ -z "$print" ]; then echo case "$shell" in fish ) - echo 'status --is-interactive; and . (rbenv init -|psub)' + echo 'status --is-interactive; and source (rbenv init -|psub)' ;; * ) echo 'eval "$(rbenv init -)"' From 8b0b51a166d6bcbe83fd467a70ec8919645aabfa Mon Sep 17 00:00:00 2001 From: Donald Merand Date: Sat, 20 Feb 2016 10:27:39 -0500 Subject: [PATCH 2/2] convert references to '.' to 'source' for fish shell --- libexec/rbenv-init | 9 +++------ test/init.bats | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/libexec/rbenv-init b/libexec/rbenv-init index 7ddae5e5..ac9d4cf0 100755 --- a/libexec/rbenv-init +++ b/libexec/rbenv-init @@ -70,7 +70,7 @@ if [ -z "$print" ]; then echo case "$shell" in fish ) - echo 'status --is-interactive; and . (rbenv init -|psub)' + echo 'status --is-interactive; and source (rbenv init -|psub)' ;; * ) echo 'eval "$(rbenv init -)"' @@ -97,10 +97,7 @@ esac completion="${root}/completions/rbenv.${shell}" if [ -r "$completion" ]; then - case "$shell" in - fish ) echo ". '$completion'" ;; - * ) echo "source '$completion'" ;; - esac + echo "source '$completion'" fi if [ -z "$no_rehash" ]; then @@ -117,7 +114,7 @@ function rbenv switch "\$command" case ${commands[*]} - . (rbenv "sh-\$command" \$argv|psub) + source (rbenv "sh-\$command" \$argv|psub) case '*' command rbenv "\$command" \$argv end diff --git a/test/init.bats b/test/init.bats index d7005489..95be301c 100644 --- a/test/init.bats +++ b/test/init.bats @@ -47,13 +47,13 @@ OUT root="$(cd $BATS_TEST_DIRNAME/.. && pwd)" run rbenv-init - fish assert_success - assert_line ". '${root}/test/../libexec/../completions/rbenv.fish'" + assert_line "source '${root}/test/../libexec/../completions/rbenv.fish'" } @test "fish instructions" { run rbenv-init fish assert [ "$status" -eq 1 ] - assert_line 'status --is-interactive; and . (rbenv init -|psub)' + assert_line 'status --is-interactive; and source (rbenv init -|psub)' } @test "option to skip rehash" {