Only remove orphans if there are any

This commit is contained in:
David Heinemeier Hansson 2025-08-24 20:53:24 +02:00
parent 3363fe0544
commit af9ab9069f

View File

@ -13,6 +13,9 @@ else
echo
fi
echo -e "\e[32m\nRemove orphan system packages\e[0m"
sudo pacman -Rs --noconfirm $(pacman -Qtdq)
echo
orphans=$(pacman -Qtdq)
if [[ -n $orphans ]]; then
echo -e "\e[32m\nRemove orphan system packages\e[0m"
sudo pacman -Rs --noconfirm "$orphans"
echo
fi