diff --git a/libexec/rbenv-init b/libexec/rbenv-init index e8ae8d5a..1661a052 100755 --- a/libexec/rbenv-init +++ b/libexec/rbenv-init @@ -86,7 +86,7 @@ mkdir -p "${RBENV_ROOT}/"{shims,versions} case "$shell" in fish ) - echo 'set -gx PATH '${RBENV_ROOT}'/shims $PATH' + echo "set -gx PATH '${RBENV_ROOT}/shims' \$PATH" echo "set -gx RBENV_SHELL $shell" ;; * ) diff --git a/test/init.bats b/test/init.bats old mode 100644 new mode 100755 index 95be301c..6cf64e8b --- a/test/init.bats +++ b/test/init.bats @@ -73,7 +73,7 @@ OUT export PATH="${BATS_TEST_DIRNAME}/../libexec:/usr/bin:/bin:/usr/local/bin" run rbenv-init - fish assert_success - assert_line 0 "setenv PATH '${RBENV_ROOT}/shims' \$PATH" + assert_line 0 "set -gx PATH '${RBENV_ROOT}/shims' \$PATH" } @test "can add shims to PATH more than once" { @@ -87,7 +87,7 @@ OUT export PATH="${RBENV_ROOT}/shims:$PATH" run rbenv-init - fish assert_success - assert_line 0 "setenv PATH '${RBENV_ROOT}/shims' \$PATH" + assert_line 0 "set -gx PATH '${RBENV_ROOT}/shims' \$PATH" } @test "outputs sh-compatible syntax" {