no-mistakes(review): Remove retired OpenCode 2 npm beta during rebuild

This commit is contained in:
Lap Tran committed 2026-11-08 12:23:20 -05:00
1 parent 1fda5c09b7
commit 2a147c911a
2 files changed
+16 -1

No files matched your search

+15
View File
@@ -32,6 +32,21 @@ else
echo "==> OpenCode 1.x already installed: $(${OPENCODE_BIN} --version)"
fi
# Remove the retired OpenCode 2 beta (@opencode-ai/cli, binary "opencode2") if
# an older rebuild installed it. The stable Homebrew `opencode` formula declared
# in configuration.nix is now the only OpenCode 2 install. Local check only, so
# an offline rebuild skips this instead of failing.
NPM=/opt/homebrew/bin/npm
if [ -x "$NPM" ] && beta_root="$("$NPM" root -g 2>/dev/null)" && [ -d "$beta_root/@opencode-ai/cli" ]; then
echo "==> Removing retired OpenCode 2 beta (@opencode-ai/cli)..."
if "$NPM" uninstall -g @opencode-ai/cli 2>&1; then
echo "==> OpenCode 2 beta removed"
else
echo "==> WARNING: OpenCode 2 beta removal failed. Remove it manually:"
echo " $NPM uninstall -g @opencode-ai/cli"
fi
fi
echo "==> Updating no-mistakes..."
NO_MISTAKES_BIN="$HOME/.no-mistakes/bin/no-mistakes"
if [ -x "$NO_MISTAKES_BIN" ]; then