Fixed infinite freeze

This commit is contained in:
Chris Toph 2025-04-27 15:53:13 -04:00
parent ac120b6a27
commit 88b6573952
3 changed files with 38 additions and 29 deletions

View file

@ -15,7 +15,7 @@ function __yay_tar
echo " -v, --verbose Enable verbose output"
echo " -h, --help Show this help message"
echo ""
echo "Supported compression types: :D"
echo "Supported compression types:"
echo " 7zip - .7z or .tar.7z (levels: 0-9, default 5, threads: yes)"
echo " bzip2 - .tar.bz2 (levels: 1-9, default 9)"
echo " bzip3 - .tar.bz3 (block size in MiB: 1-511, default 16, threads: yes)"

View file

@ -1,26 +1,34 @@
#!/usr/bin/env fish
# Main dispatch
if test (count $argv) -eq 0
echo "Usage: yay <command> [args]"
echo "Commands: rebuild, update, garbage, try, tar, untar"
exit 1
end
function yay_function
# Main dispatch
if test (count $argv) -eq 0
echo "yay! :D"
echo "Usage: yay <command> [args]"
echo "Commands: rebuild, update, garbage, try, tar, untar"
exit 1
end
switch $argv[1]
case rebuild
__yay_rebuild $argv[2..-1]; or exit $status
case update
__yay_update $argv[2..-1]; or exit $status
case garbage
__yay_garbage; or exit $status
case try
__yay_try $argv[2..-1]; or exit $status
case tar
__yay_tar $argv[2..-1]; or exit $status
case untar
__yay_untar $argv[2..-1]; or exit $status
case '*'
__yay_red "Unknown subcommand: $argv[1]"
exit 1
end
switch $argv[1]
case rebuild
__yay_rebuild $argv[2..-1]; or exit $status
case update
__yay_update $argv[2..-1]; or exit $status
case garbage
__yay_garbage; or exit $status
case try
__yay_try $argv[2..-1]; or exit $status
case tar
__yay_tar $argv[2..-1]; or exit $status
case untar
__yay_untar $argv[2..-1]; or exit $status
case '*'
__yay_red "Unknown subcommand: $argv[1]"
exit 1
end
end
# For direct fish shell usage
function yay
yay_function $argv
end

View file

@ -14,11 +14,11 @@ let
cp ${../share/fish/completions}/yay.fish $out/share/fish/completions/
'';
# Create main yay binary that ensures fish is available
# Create main yay binary that uses fish's function path
yayBin = pkgs.writeShellScriptBin "yay" ''
exec ${pkgs.fish}/bin/fish -c "yay $*"
FUNCTIONS_DIR=$(dirname $(dirname $0))/share/fish/functions
exec ${lib.getExe pkgs.fish} -c "set fish_function_path \$fish_function_path $FUNCTIONS_DIR; source $FUNCTIONS_DIR/yay.fish; yay_function $@"
'';
in
pkgs.symlinkJoin {
name = "yay";
@ -34,6 +34,7 @@ pkgs.symlinkJoin {
wrapProgram $out/bin/yay \
--prefix PATH : ${
lib.makeBinPath [
pkgs.fish
pkgs.nh
pkgs.jq
pkgs.gzip