From 4d0662b09e9cd5239c9f1f617bbb16fc10082d3f Mon Sep 17 00:00:00 2001 From: Lap Tran Date: Sat, 7 Nov 2026 09:50:12 -0500 Subject: [PATCH] rebuild.sh: update pi extensions on every rebuild --- rebuild.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/rebuild.sh b/rebuild.sh index 6b4b1c6..e91cf9c 100755 --- a/rebuild.sh +++ b/rebuild.sh @@ -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