AutoYADM commit: 2025-04-16 15:25:12
This commit is contained in:
parent
cce1bcc9bf
commit
466a488826
1 changed files with 39 additions and 4 deletions
|
@ -1,6 +1,41 @@
|
|||
function update --description "Update everything"
|
||||
cargo install-update -a
|
||||
set -l termcmd foot fish -c
|
||||
set -l lines 'cargo install-update -a
|
||||
gup update
|
||||
uv tool upgrade --all
|
||||
paru -Syu
|
||||
flatpak update'
|
||||
set -l cmds (string split \n -- $lines | string trim)
|
||||
echo Commands to be run:
|
||||
for i in $cmds
|
||||
echo $i
|
||||
end
|
||||
if isatty stdin; and isatty stdout
|
||||
while read --nchars 1 -l response --prompt-str="Run on multiple terminals? (y/n)" or return 1
|
||||
switch $response
|
||||
case y Y
|
||||
for cmd in $cmds
|
||||
# max 2 jobs at a time
|
||||
while test (count (jobs -p)) -ge 2
|
||||
sleep 0.5
|
||||
end
|
||||
$termcmd $cmd &>/dev/null &
|
||||
end
|
||||
wait
|
||||
break
|
||||
case n N
|
||||
for cmd in $cmds
|
||||
eval $cmd
|
||||
end
|
||||
break
|
||||
case '*'
|
||||
echo Invalid input!
|
||||
continue
|
||||
end
|
||||
end
|
||||
else
|
||||
for cmd in $cmds
|
||||
eval $cmd
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue