Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: robertpateii/node-supervisor
base: 3cad4aaa08
...
head fork: robertpateii/node-supervisor
compare: bba90dd1a0
Checking mergeability… Don't worry, you can still create the pull request.
  • 5 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Showing with 20 additions and 0 deletions.
  1. +6 −0 README.md
  2. +14 −0 lib/supervisor.js
View
6 README.md
@@ -40,6 +40,12 @@ clean up all the inter-module references, and without a whole new
Supervisor will wait for a change in the source files.
If "error", an exit code of 0 will still restart.
If "exit", no restart regardless of exit code.
+
+ -d|--debug
+ Start node with --debug flag.
+
+ -k|--debug-brk
+ Start node with --debug-brk flag.
-h|--help|-?
Display these usage instructions.
View
14 lib/supervisor.js
@@ -5,6 +5,7 @@ var fileExtensionPattern;
var startChildProcess;
var noRestartOn = null;
var debug = true;
+var nodeArgs = [];
exports.run = run;
@@ -25,6 +26,10 @@ function run (args) {
extensions = args.shift();
} else if (arg === "--exec" || arg === "-x") {
executor = args.shift();
+ } else if ( arg === "--debug" || arg === "-d" ) {
+ nodeArgs.push('--debug');
+ } else if ( arg === "--debug-brk" || arg === "-k" ) {
+ nodeArgs.push('--debug-brk');
} else if (arg === "--no-restart-on" || arg === "-n") {
noRestartOn = args.shift();
} else if (arg === "--") {
@@ -114,6 +119,12 @@ function help () {
(" When a change to a js file occurs, reload the program")
(" Default is '.'")
("")
+ (" -d|--debug")
+ (" Start node with --debug flag.")
+ ("")
+ (" -k|--debug-brk")
+ (" Start node with --debug-brk flag.")
+ ("")
(" -p|--poll-interval <milliseconds>")
(" How often to poll watched files for changes.")
(" Defaults to Node default.")
@@ -153,6 +164,9 @@ function startProgram (prog, exec, args) {
else
util.debug("Starting child process with '" + exec + " " + prog + "'");
var spawnme = args ? [prog].concat(args) : [prog];
+ if ( nodeArgs ) {
+ spawnme = nodeArgs.concat(spawnme)
+ }
crash_queued = false;
var child = exports.child = spawn(exec, spawnme);
child.stdout.addListener("data", function (chunk) { chunk && util.print(chunk); });

No commit comments for this range

Something went wrong with that request. Please try again.