no-mistakes(review): Fix updater ownership and behavioral coverage

This commit is contained in:
Lap Tran committed 2026-11-23 13:10:09 -05:00
1 parent 4e1b65b5d2
commit 4a31495181
4 files changed
+291 -81

No files matched your search

+6 -19
View File
@@ -2,8 +2,8 @@
# Rebuild nix-darwin + home-manager from this checkout.
#
# Before the switch, update every installed component that is not declarative:
# Homebrew formulae and casks, npm globals (through Homebrew's node, never
# Nix's npm), no-mistakes, Hermes Agent, and the flake inputs. After the switch,
# npm globals (through Homebrew's node, never Nix's npm), no-mistakes,
# Hermes Agent, and the flake inputs. After the switch,
# update the installed agent skills and Pi extensions against the upgraded
# binaries.
#
@@ -16,18 +16,6 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
ln -sfn "$DIR" ~/.dotfiles
NPM=/opt/homebrew/bin/npm
# Homebrew: configuration.nix declares the formulae and casks, and the nix-darwin
# activation upgrades them too. This explicit pass reports what moved before the
# switch and keeps the same warning-not-fail behaviour when the network is down.
echo "==> Updating Homebrew formulae and casks..."
if ! command -v brew >/dev/null 2>&1; then
echo "==> WARNING: brew not found. Skipping Homebrew update."
elif brew update 2>&1 && brew upgrade 2>&1; then
echo "==> Homebrew update complete"
else
echo "==> WARNING: Homebrew update failed (network or package issue). Continuing with installed versions."
fi
# npm globals are installed outside Nix and Homebrew, so no other step moves
# them. Use /opt/homebrew/bin/npm explicitly: the activation PATH can resolve
# Nix's npm, which cannot write the Homebrew prefix, and these packages belong to
@@ -52,6 +40,9 @@ process.stdin.on("end", () => {
} catch {}
});
' "$pkg" || true)"
if [ -z "$installed" ]; then
return 0
fi
latest="$("$NPM" view "$pkg" version --fetch-timeout=15000 --fetch-retries=1 2>/dev/null \
| tr -d '[:space:]' || true)"
if [ -z "$latest" ]; then
@@ -62,9 +53,7 @@ process.stdin.on("end", () => {
echo "==> $pkg already at $latest"
return 0
fi
current="$installed"
[ -n "$current" ] || current=none
echo "==> $pkg $current -> $latest"
echo "==> $pkg $installed -> $latest"
if "$NPM" install -g "$pkg@$latest" >/dev/null 2>&1; then
echo "==> $pkg installed at $latest"
else
@@ -76,8 +65,6 @@ process.stdin.on("end", () => {
# here so it reaches the latest release; the activation only fills a gap.
npm_globals=(
"@steipete/bird"
acpx
backpass
chrome-devtools-axi
defuddle
forgejo-axi