Skip to content

Instantly share code, notes, and snippets.

@alexkolson
Created July 27, 2016 10:44
Show Gist options
  • Save alexkolson/d669fc0152fabb1a1313f032d04a9d2c to your computer and use it in GitHub Desktop.
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.
#!/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