diff --git a/spec/init_spec.md b/spec/init_spec.md index 58da375..6e61448 100644 --- a/spec/init_spec.md +++ b/spec/init_spec.md @@ -44,8 +44,8 @@ Key elements: ```fish function try - set -l out (/path/to/try exec --path '/default/tries/path' $argv 2>/dev/tty) - if test $status -eq 0 + set -l out (/path/to/try exec --path '/default/tries/path' $argv 2>/dev/tty | string collect) + if test $pipestatus[1] -eq 0 eval $out else echo $out diff --git a/try.rb b/try.rb index f14355a..f23d700 100755 --- a/try.rb +++ b/try.rb @@ -1015,7 +1015,7 @@ def cmd_init!(args, tries_path) fish_script = <<~SHELL function try set -l out (/usr/bin/env ruby '#{script_path}' exec#{path_arg} $argv 2>/dev/tty | string collect) - if test $status -eq 0 + if test $pipestatus[1] -eq 0 eval $out else echo $out