Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions try.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,9 @@ def cmd_init!(args, tries_path)
end

path_arg = tries_path ? " --path '#{tries_path}'" : ""
export_line = tries_path ? "export TRY_PATH='#{tries_path}'" : ""
bash_or_zsh_script = <<~SHELL
#{export_line}
try() {
local out
out=$(/usr/bin/env ruby '#{script_path}' exec#{path_arg} "$@" 2>/dev/tty)
Expand All @@ -1180,7 +1182,9 @@ def cmd_init!(args, tries_path)
}
SHELL

fish_export = tries_path ? "set -gx TRY_PATH '#{tries_path}'" : ""
fish_script = <<~SHELL
#{fish_export}
function try
set -l out (/usr/bin/env ruby '#{script_path}' exec#{path_arg} $argv 2>/dev/tty | string collect)
if test $pipestatus[1] -eq 0
Expand Down