From e597df70d70b8087ede2d221959dfb5afa8fa2c8 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Sat, 2 Jul 2016 11:05:04 -0700 Subject: [PATCH] Check if fish -c string will work first. --- share/functions/string.fish | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/functions/string.fish b/share/functions/string.fish index 8e4b17c5f..e8b961bf9 100644 --- a/share/functions/string.fish +++ b/share/functions/string.fish @@ -16,8 +16,10 @@ if not contains string (builtin -n) end # We hope that in $__fish_bin_path is a newer fish that can do `string` for us. - set fish_user_paths $__fish_bin_dir $fish_user_paths + set PATH $__fish_bin_dir $PATH set string_cmd string \'$argv\' - fish -c "$string_cmd" - end + fish -c 'contains string (builtin -n)' + and fish -c "$string_cmd" + or return 127 + end end