Guest User

Untitled

a guest
Oct 20th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # ./node-debug.sh app.js
  4. #
  5.  
  6. function usage() {
  7. echo "Usage $0 [-p port] [jsfile]"
  8. exit 1
  9. }
  10.  
  11. while getopts p: OPT; do
  12. case $OPT in
  13. "p") PORT=$OPTARG
  14. ;;
  15. *) usage
  16. ;;
  17. esac
  18. done
  19.  
  20. if [ -z $PORT ]; then
  21. PORT=8989
  22. fi
  23.  
  24. shift `expr $OPTIND - 1`
  25.  
  26. node-inspector --web-port=$PORT &
  27. if [ $? -eq 0 ]; then
  28. node --debug $1
  29. fi
Add Comment
Please, Sign In to add comment