Created
June 13, 2012 12:27
-
-
Save aoi0308/2923760 to your computer and use it in GitHub Desktop.
Nodeデバッグ用シェルスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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