Only attempt operation if a package name is selected

This commit is contained in:
David Heinemeier Hansson 2025-08-06 15:19:53 +02:00
parent e3a3b98e0a
commit 58fbda80ef
2 changed files with 12 additions and 4 deletions

View File

@ -1,5 +1,9 @@
#!/bin/bash
yay -Slq | fzf --multi --preview 'yay -Sii {1}' --preview-window=down:75% | xargs -ro yay -S --noconfirm && sudo updatedb
pkg_name=$(yay -Slq | fzf --multi --preview 'yay -Sii {1}' --preview-window=down:75%)
~/.local/share/omarchy/bin/omarchy-show-done
if [[ -n "$pkg_name" ]]; then
yay -Sy --noconfirm "$pkg_name"
sudo updatedb
~/.local/share/omarchy/bin/omarchy-show-done
fi

View File

@ -1,5 +1,9 @@
#!/bin/bash
yay -Qqe | fzf --multi --preview 'yay -Qi {1}' --preview-window=down:75% | xargs -ro yay -Rns --noconfirm && sudo updatedb
pkg_name=$(yay -Qqe | fzf --multi --preview 'yay -Qi {1}' --preview-window=down:75%)
~/.local/share/omarchy/bin/omarchy-show-done
if [[ -n "$pkg_name" ]]; then
yay -Rns --noconfirm "$pkg_name"
sudo updatedb
~/.local/share/omarchy/bin/omarchy-show-done
fi