Accept stdin in pacman and yay commands

This commit is contained in:
Manuel Thalmann 2024-09-13 16:32:26 +02:00
parent e2c85fafdc
commit 67e8e27a10

View file

@ -4,7 +4,10 @@ begin
source "$dir/../../Common/Scripts/software.fish" source "$dir/../../Common/Scripts/software.fish"
function runYay -d "Run yay with pre-configured defaults" function runYay -d "Run yay with pre-configured defaults"
yay --needed --answerclean=None --answerdiff=None -Syu $argv if not isatty 0
echo "stdin detected" 1>&2
cat
end | yay --needed --answerclean=None --answerdiff=None -Syu $argv
end end
function yayinst -d "Install yay-package non-interactively" function yayinst -d "Install yay-package non-interactively"
@ -12,7 +15,10 @@ begin
end end
function runPacman -d "Run pacman with pre-configured defaults" function runPacman -d "Run pacman with pre-configured defaults"
sudo pacman --needed -Syu $argv if not isatty 0
echo "stdin detected" 1>&2
cat
end | sudo pacman --needed -Syu $argv
end end
function pacinst -d "Install pacman-package non-interactively" function pacinst -d "Install pacman-package non-interactively"