fix: allow skipping daemonization

This commit is contained in:
Alexis
2021-10-04 13:22:19 +10:30
parent 31e1dd121a
commit 120fdbc33f
+6
View File
@@ -25,6 +25,7 @@ interface Flags {
command?: string;
help?: boolean;
debug?: boolean;
'no-daemon'?: boolean;
port?: string;
'log-level'?: string;
'log-transport'?: string;
@@ -136,6 +137,11 @@ const commands = {
const indexPath = './index.js';
require(indexPath);
// Skip daemonizing
if (mainOptions['no-daemon']) {
return;
}
if (!mainOptions.debug) {
if ('_DAEMONIZE_PROCESS' in process.env) {
// In the child, clean up the tracking environment variable