rebuild.sh: update pi extensions on every rebuild #13

Merged
hermes merged 1 commits from fm/dotfiles-rebuild-pi-extensions-update into main 2026-11-07 10:20:32 -05:00
+13 -2
View File
@@ -2,7 +2,7 @@
# Rebuild nix-darwin + home-manager. Rotates stale home-manager *.backup files
# so a second switch never fails with "would be clobbered".
# Also updates flake inputs, upgrades grok-build, installs OpenCode 1.x
# (stable CLI for free-tier), and updates no-mistakes.
# (stable CLI for free-tier), updates no-mistakes, and updates pi extensions.
set -euo pipefail
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
ln -sfn "$DIR" ~/.dotfiles
@@ -100,4 +100,15 @@ else
echo "==> WARNING: flake update failed. Continuing with locked inputs."
fi
exec sudo darwin-rebuild switch --flake ~/.dotfiles#lt-mbp
sudo darwin-rebuild switch --flake ~/.dotfiles#lt-mbp
# Update installed pi packages after the switch, because the Homebrew bundle
# may have upgraded the pi binary.
echo "==> Updating pi extensions..."
if ! command -v pi >/dev/null 2>&1; then
echo "==> WARNING: pi not found. Skipping extension update."
elif pi update --extensions --no-approve 2>&1; then
echo "==> pi extension update complete"
else
echo "==> WARNING: pi extension update failed. Skipping."
fi