make lint runs shellcheck on every tracked bash script, make test runs the bats suite in tests/, and make check runs both. The tests cover the update orchestrator (hook isolation, failure reporting, pull and free-space handling) and utils.sh (migrations, package install and removal, services, initramfs build check), using stub commands so they never touch the real system. Fixes from the first lint run: 20-aur.sh stops if a cd fails rather than building or deleting in the wrong directory, and 80-gnome-extensions.sh refuses to rm -rf with an empty path. The rest are false positives, silenced in .shellcheckrc or per line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
645 B
Bash
24 lines
645 B
Bash
#!/bin/bash
|
|
|
|
echo "Updating AUR..."
|
|
|
|
YAY_FLAGS="--noconfirm --answerdiff=None --answeredit=None --answerclean=None"
|
|
|
|
# Only rebuild yay when yay itself is broken (e.g. a pacman upgrade bumped
|
|
# libalpm). A failing AUR package is not fixed by a rebuild, so let that error
|
|
# show and fail the hook instead.
|
|
if ! yay --version &>/dev/null; then
|
|
echo "yay is broken (likely a libalpm bump). Rebuilding yay..."
|
|
sudo pacman -R --noconfirm yay
|
|
cd /tmp || exit 1
|
|
rm -rf yay
|
|
git clone https://aur.archlinux.org/yay.git
|
|
cd yay || exit 1
|
|
makepkg -si --noconfirm
|
|
cd ..
|
|
rm -rf yay
|
|
cd || exit 1
|
|
fi
|
|
|
|
yay -Sua $YAY_FLAGS
|