File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed
Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -52,3 +52,4 @@ zap-pretty
5252act
5353parquet-tools
5454osv-scanner
55+ chrome-devtools-mcp
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ [ -z " $DEBUG " ] || set -x
3+ set -e
4+
5+ YBIN=" $( dirname $0 ) "
6+ PACKAGE_NAME=" chrome-devtools-mcp"
7+ VERSION=" latest"
8+
9+ if ! command -v npm & > /dev/null; then
10+ echo " npm is required but not installed" 1>&2
11+ exit 1
12+ fi
13+
14+ # Get the package version info
15+ if [ " $VERSION " = " latest" ]; then
16+ ACTUAL_VERSION=$( cd $YBIN ; npm view $PACKAGE_NAME version)
17+ else
18+ ACTUAL_VERSION=$VERSION
19+ fi
20+
21+ BIN_DIR=" $YBIN /y-$PACKAGE_NAME -$ACTUAL_VERSION -bin"
22+
23+ # Download and install if not already cached
24+ if [ ! -d " $BIN_DIR " ]; then
25+ echo " Installing $PACKAGE_NAME @$ACTUAL_VERSION ..." 1>&2
26+
27+ TEMP_DIR=$( mktemp -d)
28+ trap " rm -rf $TEMP_DIR " EXIT
29+
30+ cd " $TEMP_DIR "
31+ npm install " $PACKAGE_NAME @$ACTUAL_VERSION " --prefix . --no-save --omit=dev --ignore-scripts
32+
33+ # Move the installed package to cache
34+ mv " $TEMP_DIR /node_modules/$PACKAGE_NAME " " $BIN_DIR "
35+ fi
36+
37+ # Installed, now run with our rules
38+
39+ if echo " $@ " | grep -q " \-\-help" ; then
40+ true
41+ elif echo " $@ " | grep -q " \-\-version" ; then
42+ true
43+ elif ! echo " $@ " | grep -q " \-\-isolated" ; then
44+ echo " Error: $0 requires --isolated" 1>&2
45+ [ " DEVTOOLS_MCP_ALLOW_NON_ISOLATED" = " 1" ] && echo " Overriding due to DEVTOOLS_MCP_ALLOW_NON_ISOLATED=$DEVTOOLS_MCP_ALLOW_NON_ISOLATED " 1>&2 || exit 1
46+ fi
47+
48+ /usr/bin/env node $BIN_DIR /build/src/index.js " $@ "
You can’t perform that action at this time.
0 commit comments