Created
July 27, 2016 10:44
-
-
Save alexkolson/d669fc0152fabb1a1313f032d04a9d2c to your computer and use it in GitHub Desktop.
An unobtrusive utility script to run loopback apps with nodemon for debugging purposes.
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
#!/usr/bin/env bash | |
main() { | |
read -r -d '' nodemonjson <<EOF | |
{ | |
"ignoreRoot": [".git", ".nyc_output", "nodemon.json"] | |
} | |
EOF | |
trap "uninstall_nodemon" INT | |
npm install nodemon | |
echo "$nodemonjson" > nodemon.json | |
./node_modules/.bin/nodemon . | |
} | |
uninstall_nodemon() { | |
trap SIGINT | |
rm nodemon.json | |
npm uninstall nodemon | |
exit 0 | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment