Skip to content

Commit d9ab693

Browse files
authored
Merge pull request #95 from adam12/fix-fish-function
fix: use $pipestatus[1] in fish init to check ruby exit status
2 parents 47a97a2 + 9f71925 commit d9ab693

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spec/init_spec.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Key elements:
4444

4545
```fish
4646
function try
47-
set -l out (/path/to/try exec --path '/default/tries/path' $argv 2>/dev/tty)
48-
if test $status -eq 0
47+
set -l out (/path/to/try exec --path '/default/tries/path' $argv 2>/dev/tty | string collect)
48+
if test $pipestatus[1] -eq 0
4949
eval $out
5050
else
5151
echo $out

try.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ def cmd_init!(args, tries_path)
10151015
fish_script = <<~SHELL
10161016
function try
10171017
set -l out (/usr/bin/env ruby '#{script_path}' exec#{path_arg} $argv 2>/dev/tty | string collect)
1018-
if test $status -eq 0
1018+
if test $pipestatus[1] -eq 0
10191019
eval $out
10201020
else
10211021
echo $out

0 commit comments

Comments
 (0)