nwjs/npm-installer

Setting the exit code

jaredmcateer opened this issue · 2 comments

I am maintaining an app that relies on the exit code to change based on certain conditions, even though the nw app itself closes cleanly, as it is spawned by a parent process that monitors it. Currently we've an older version of node-webkit forked with the following change and I'm trying to upgrade. Do you have any desire for a PR that changes

bin/nw:

 // Spawn node-webkit
  var nw = spawn(bin, args, { stdio: 'inherit' });
  nw.on('close', function() {
    process.nextTick(function() {
      process.exit(0);
    });
  });

to

  // Spawn node-webkit
  var nw = spawn(bin, args, { stdio: 'inherit' });
  nw.on('close', function(code) {
    process.nextTick(function() {
      process.exit(code);
    });
  });

Better yet if there's a way to achieve this with the existing code that would be great too. My problem is maintaining a downstream fork that will make this simple change every time there is a release of this repository.

Looks like a good idea. (I'd accept such pull request.)