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