Comparing version 0.0.6 to 0.0.7
@@ -23,4 +23,5 @@ 'use strict'; | ||
var DEFAULT_OPTIONS = { | ||
catchSignals: true, | ||
catchErrors: true, | ||
catchSignals: true, | ||
exitProcess: true, | ||
showErrors: true, | ||
@@ -216,2 +217,6 @@ logTimes: true, | ||
{ | ||
if (self.options.exitProcess) | ||
{ | ||
process.exit(1); | ||
} | ||
return; | ||
@@ -235,2 +240,13 @@ } | ||
} | ||
else | ||
{ | ||
if (self.options.showErrors) | ||
{ | ||
log.error('Error while finishing in phase %s', phase); | ||
} | ||
if (self.options.exitProcess) | ||
{ | ||
process.exit(1); | ||
} | ||
} | ||
} | ||
@@ -274,2 +290,6 @@ | ||
self.emit('end'); | ||
if (self.options.exitProcess) | ||
{ | ||
process.exit(0); | ||
} | ||
}); | ||
@@ -276,0 +296,0 @@ }); |
{ | ||
"name": "inits", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Init system for Node.js.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/alexfernandez/inits", |
@@ -163,2 +163,9 @@ [](http://travis-ci.org/alexfernandez/inits) | ||
### exitProcess | ||
If set to `true` (or any other truthy value), | ||
`inits` will exit after shutdown | ||
(with code 0 if successful, or code 1 if it fails). | ||
Default: `true`. | ||
### showErrors | ||
@@ -165,0 +172,0 @@ |
@@ -22,2 +22,3 @@ 'use strict'; | ||
var system = new inits.InitSystem(); | ||
system.options.exitProcess = false; | ||
var witness = {}; | ||
@@ -70,2 +71,3 @@ system.on('error', function(error) | ||
var system = new inits.InitSystem(); | ||
system.options.exitProcess = false; | ||
var witness = {}; | ||
@@ -106,2 +108,3 @@ system.on('error', function(error) | ||
var system = new inits.InitSystem(); | ||
system.options.exitProcess = false; | ||
var witness = {}; | ||
@@ -155,2 +158,3 @@ system.on('error', function(error) | ||
var system = new inits.InitSystem(); | ||
system.options.exitProcess = false; | ||
system.options.showErrors = false; | ||
@@ -157,0 +161,0 @@ var init1 = false; |
22314
540
318