From 19ae300eb8c5071b6712b20bf3f52f7bfccfecc4 Mon Sep 17 00:00:00 2001 From: Roman Levin Date: Sun, 16 Feb 2020 22:58:20 +0100 Subject: [PATCH 1/3] Fix fish shell initialization Since fish 3.10 at least, the current way of loading rbenv in `fish` is misbehaving, at least in some environments: ``` source: Error encountered while sourcing file '/var/folders/pj/jn249gcn7ddfrjzj2_9mxjhw0000gp/T//.psub.f0iJSWRByB': source: No such file or directory ``` This changes the initialization to the method recommended by a `fish` developer here: https://github.com/fish-shell/fish-shell/issues/6613#issuecomment-586679958 --- libexec/rbenv-init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rbenv-init b/libexec/rbenv-init index 7fb7ccd..4fb8d2e 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 source (rbenv init -|psub)' + echo 'status --is-interactive; and rbenv init - | source' ;; * ) echo 'eval "$(rbenv init -)"' From ac5dce901433fb4e0f02f2fc71b8d571d85da6b1 Mon Sep 17 00:00:00 2001 From: Roman Levin Date: Mon, 17 Feb 2020 21:32:12 +0100 Subject: [PATCH 2/3] Remove another `fish` psub usage --- libexec/rbenv-init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rbenv-init b/libexec/rbenv-init index 4fb8d2e..cd327fa 100755 --- a/libexec/rbenv-init +++ b/libexec/rbenv-init @@ -114,7 +114,7 @@ function rbenv switch "\$command" case ${commands[*]} - source (rbenv "sh-\$command" \$argv|psub) + rbenv "sh-\$command" \$argv|source case '*' command rbenv "\$command" \$argv end From 74c2486a2cdccca082ee1e2226159b64de803064 Mon Sep 17 00:00:00 2001 From: Roman Levin Date: Mon, 17 Feb 2020 21:46:25 +0100 Subject: [PATCH 3/3] Fix fish instructions test --- test/init.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/init.bats b/test/init.bats index 6ea662b..d780cc5 100755 --- a/test/init.bats +++ b/test/init.bats @@ -54,7 +54,7 @@ OUT @test "fish instructions" { run rbenv-init fish assert [ "$status" -eq 1 ] - assert_line 'status --is-interactive; and source (rbenv init -|psub)' + assert_line 'status --is-interactive; and rbenv init - | source' } @test "option to skip rehash" {