Skip to content

Instantly share code, notes, and snippets.

@aoi0308
Created June 13, 2012 12:27
Show Gist options
  • Save aoi0308/2923760 to your computer and use it in GitHub Desktop.
Save aoi0308/2923760 to your computer and use it in GitHub Desktop.
Nodeデバッグ用シェルスクリプト
#!/bin/bash
#
# ./node-debug.sh app.js
#
function usage() {
echo "Usage $0 [-p port] [jsfile]"
exit 1
}
while getopts p: OPT; do
case $OPT in
"p") PORT=$OPTARG
;;
*) usage
;;
esac
done
if [ -z $PORT ]; then
PORT=8989
fi
shift `expr $OPTIND - 1`
node-inspector --web-port=$PORT &
if [ $? -eq 0 ]; then
node --debug $1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment