aboutsummaryrefslogtreecommitdiff
path: root/mcp/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'mcp/run.sh')
-rwxr-xr-xmcp/run.sh25
1 files changed, 1 insertions, 24 deletions
diff --git a/mcp/run.sh b/mcp/run.sh
index 27c8ad9..6fca661 100755
--- a/mcp/run.sh
+++ b/mcp/run.sh
@@ -53,31 +53,8 @@ if ! cmp -s "${here}/package-lock.json" "${stamp}" 2>/dev/null; then
trap - EXIT
fi
-# Chrome loads the companion extension from ./extension rather than from node_modules, where it
-# ships: npm ci deletes that whole tree when dependencies change, and an unpacked extension whose
-# folder disappears is disabled until someone loads it again by hand. This copy is refreshed only
-# when pi-chrome's version of it differs, so a reinstall that changes nothing leaves Chrome alone.
-# Compared by content, not by the manifest's version: two releases could ship the same version of
-# the extension with different files, and a copy that silently stayed behind would be debugged as a
-# server bug.
-packaged="${here}/node_modules/pi-chrome/extensions/chrome-profile-bridge/browser-extension"
-if [ -d "${packaged}" ]; then
- digest="$(cd "${packaged}" && find . -type f -print | sort | xargs cat | cksum)"
- # Kept beside the folder rather than in it: Chrome loads that folder, and nothing there should
- # be anything but the extension.
- stamp_ext="${here}/.extension-source"
- if [ "${digest}" != "$(cat "${stamp_ext}" 2>/dev/null || true)" ]; then
- echo "pi-chrome-mcp: updating ./extension; reload it at chrome://extensions" >&2
- rm -rf "${here}/extension.new"
- cp -R "${packaged}" "${here}/extension.new"
- rm -rf "${here}/extension"
- mv "${here}/extension.new" "${here}/extension"
- echo "${digest}" > "${stamp_ext}"
- fi
-fi
-
if [ "${1:-}" = "--install-only" ]; then
- echo "pi-chrome-mcp: ready. Load this folder in chrome://extensions: ${here}/extension" >&2
+ echo "pi-chrome-mcp: ready. The companion extension to load in chrome://extensions: $(cd "${here}/../extensions/chrome-profile-bridge/browser-extension" && pwd)" >&2
exit 0
fi
exec node "${here}/server.mjs" "$@"