#!/bin/bash # Open the running node in the default browser. # Usage: npm run open [-- 1|2] NODE=${1:-1} PORTFILE="/tmp/p2pds-node${NODE}.port" if [ ! -f "$PORTFILE" ]; then echo "Node $NODE not running. Start with: npm run start:node${NODE}" exit 1 fi PORT=$(cat "$PORTFILE") URL="http://localhost:$PORT" echo "$URL" open "$URL"