Install exact latest pi-claude-code-provider so npm doesn't keep the old ^range
This commit is contained in:
@@ -8,6 +8,8 @@ PKG_DIR="$PI_DIR/npm/node_modules/$PKG"
|
||||
# Keep pi-claude-code-provider on the latest npm release: on every start compare the
|
||||
# installed version with the registry and force a clean reinstall when they differ.
|
||||
# If the registry is unreachable, keep whatever is installed.
|
||||
# Install the exact version: an unversioned `npm install` keeps the range already in
|
||||
# $PI_DIR/npm/package.json (e.g. ^0.2.0), which silently reinstalls the old release.
|
||||
installed=$(node -p "require('$PKG_DIR/package.json').version" 2>/dev/null || true)
|
||||
latest=$(npm view "$PKG" version 2>/dev/null || true)
|
||||
|
||||
@@ -15,7 +17,7 @@ if [ -z "$installed" ] || { [ -n "$latest" ] && [ "$installed" != "$latest" ]; }
|
||||
echo "[entrypoint] pi install npm:$PKG (installed: ${installed:-none}, latest: ${latest:-unknown})"
|
||||
mkdir -p "$PI_DIR"
|
||||
rm -rf "$PKG_DIR"
|
||||
if ! /app/node_modules/.bin/pi install "npm:$PKG"; then
|
||||
if ! /app/node_modules/.bin/pi install "npm:$PKG${latest:+@$latest}"; then
|
||||
echo "[entrypoint] pi install failed; will retry on next start" >&2
|
||||
fi
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user