@@ -22,6 +22,19 @@ YELLOW='\033[1;33m'
2222BLUE=' \033[0;34m'
2323NC=' \033[0m' # No Color
2424
25+ # Find bun executable early (use full path for subprocess compatibility)
26+ # Python subprocess doesn't always inherit shell PATH, so we need absolute path
27+ BUN_PATH=$( which bun 2> /dev/null || echo " $HOME /.bun/bin/bun" )
28+ if [ ! -x " $BUN_PATH " ]; then
29+ # Try common installation locations
30+ for candidate in " $HOME /.bun/bin/bun" " /usr/local/bin/bun" " /opt/homebrew/bin/bun" ; do
31+ if [ -x " $candidate " ]; then
32+ BUN_PATH=" $candidate "
33+ break
34+ fi
35+ done
36+ fi
37+
2538# Get the directory where this script is located
2639SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
2740PROJECT_ROOT=" $( cd " $SCRIPT_DIR /.." && pwd ) "
147160
148161# Build the bridge before testing
149162echo -e " ${BLUE} ==== Building pierre-claude-bridge for compliance testing... ====${NC} "
150- if bun run build; then
163+ echo -e " ${BLUE} Using bun at: $BUN_PATH ${NC} "
164+ if $BUN_PATH run build; then
151165 echo -e " ${GREEN} [OK] Bridge built successfully${NC} "
152166else
153167 echo -e " ${RED} [FAIL] Bridge build failed${NC} "
237251# Run MCP compliance tests (REQUIRED - NO EXCEPTIONS POLICY)
238252echo -e " ${BLUE} ==== Running MCP protocol compliance tests (REQUIRED)... ====${NC} "
239253BRIDGE_PATH=" $( pwd) /dist/cli.js"
240-
241- # Find bun executable (use full path for Python subprocess compatibility)
242- BUN_PATH=$( which bun 2> /dev/null || echo " bun" )
243- if [ " $BUN_PATH " = " bun" ]; then
244- echo -e " ${YELLOW} [WARN] Could not find bun in PATH, using 'bun' directly${NC} "
245- else
246- echo -e " ${GREEN} [OK] Found bun at: $BUN_PATH ${NC} "
247- fi
254+ echo -e " ${BLUE} Using bun at: $BUN_PATH ${NC} "
248255
249256cd " $MCP_VALIDATOR_DIR "
250257
0 commit comments