yay.nix/functions/__yay_run.fish
Chris Toph 3cfa7ed0e1 New command features for try and update, and yay_run improvement
• Replaces raw eval with a safer fish shell command execution
• Improves try commands with '--' separator for running one-shot commands
• Adds support for updating a specific flake input via flag or positional argument
• Updates documentation and completions for consistency and clarity
2025-04-30 00:43:40 -04:00

13 lines
No EOL
372 B
Fish

function __yay_run
set -l cmd_string $argv[1]
__yay_yellow "$cmd_string"
# Use fish -c for slightly safer execution than raw eval
fish -c "$cmd_string"
set -l run_status $status
if test $run_status -eq 0
__yay_green "$cmd_string"
else
__yay_red "$cmd_string (exit $run_status)"
return $run_status
end
end