no-mistakes(review): Manage lint tools and preserve Pi packages
This commit is contained in:
1 parent
4a31495181
commit
022967e277
4 files changed
+70
-48
No files matched your search
+2
-46
@@ -107,52 +107,6 @@ for link in /opt/homebrew/bin/*; do
|
||||
esac
|
||||
done
|
||||
|
||||
# The npm placeholders pi-cli@0.0.0, pi-coding-agent@0.0.1, and pi-context@2.0.0
|
||||
# are leftovers from June. Evidence they are retired, not live tools:
|
||||
# - pi-cli 0.0.0 is an unrelated 2022 package (gpio dependency) with no bin.
|
||||
# - pi-coding-agent 0.0.1 is a name-reservation placeholder with no bin; the
|
||||
# Homebrew formula owns /opt/homebrew/bin/pi.
|
||||
# - pi-context is installed and updated by Pi itself (~/.pi/agent/npm), and the
|
||||
# global copy has no bin.
|
||||
# Remove each only while those proofs hold. When pi or Pi's own copy is missing,
|
||||
# leave the global package alone and say why.
|
||||
echo "==> Removing retired npm pi packages..."
|
||||
if [ ! -x "$NPM" ]; then
|
||||
echo "==> WARNING: $NPM not found. Skipping retired pi package cleanup."
|
||||
else
|
||||
npm_root="$("$NPM" root -g 2>/dev/null || true)"
|
||||
pi_bin="$(command -v pi 2>/dev/null || true)"
|
||||
case "$pi_bin" in
|
||||
"$npm_root"/*)
|
||||
echo "==> WARNING: pi resolves to npm's global tree ($pi_bin). Leaving the npm pi packages in place."
|
||||
;;
|
||||
*)
|
||||
if [ -n "$npm_root" ]; then
|
||||
for pkg in pi-cli pi-coding-agent; do
|
||||
if [ -d "$npm_root/$pkg" ]; then
|
||||
if "$NPM" uninstall -g "$pkg" >/dev/null 2>&1; then
|
||||
echo "==> Removed retired npm package $pkg"
|
||||
else
|
||||
echo "==> WARNING: $pkg removal failed. Remove it manually: $NPM uninstall -g $pkg"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if [ -d "$HOME/.pi/agent/npm/node_modules/pi-context" ]; then
|
||||
if [ -d "$npm_root/pi-context" ]; then
|
||||
if "$NPM" uninstall -g pi-context >/dev/null 2>&1; then
|
||||
echo "==> Removed unused global pi-context (Pi keeps its own copy)"
|
||||
else
|
||||
echo "==> WARNING: pi-context removal failed. Remove it manually: $NPM uninstall -g pi-context"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "==> WARNING: Pi's own pi-context package is missing. Leaving the global copy in place."
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "==> Updating no-mistakes..."
|
||||
NO_MISTAKES_BIN="$HOME/.no-mistakes/bin/no-mistakes"
|
||||
if [ -x "$NO_MISTAKES_BIN" ]; then
|
||||
@@ -198,6 +152,8 @@ managed=(
|
||||
"$HOME/.config/opencode/opencode.json"
|
||||
"$HOME/.config/opencode2/opencode.json"
|
||||
"$HOME/.config/opencode2/AGENTS.md"
|
||||
"$HOME/.local/bin/actionlint"
|
||||
"$HOME/.local/bin/shellcheck"
|
||||
"$HOME/.local/bin/oc2"
|
||||
"$HOME/.local/bin/opencode-go-token"
|
||||
"$HOME/.local/bin/opencode-go-key-sync"
|
||||
|
||||
Reference in new issue
Block a user