Merge pull request #574 from crhultay/patch-2

Update bbs.js to for Config Init Enhancements
This commit is contained in:
Bryan Ashby
2024-11-20 18:33:53 -07:00
committed by GitHub

View File

@@ -85,17 +85,13 @@ function main() {
// then it's a fatal error // then it's a fatal error
// //
if (err) { if (err) {
if ('ENOENT' === err.code) {
if (configPathSupplied) {
console.error(
'Configuration file does not exist: ' + configFile
);
} else {
configPathSupplied = null; // make non-fatal; we'll go with defaults
}
} else {
errorDisplayed = true; errorDisplayed = true;
console.error(`Configuration error: ${err.message}`); // eslint-disable-line no-console console.error(`Configuration error: ${err.message}`); // eslint-disable-line no-console
if ('ENOENT' === err.code) {
console.error("\nConfiguration file does not exist: '{configFile}'\n\nIf this is a new installation please run './oputil.js config new' from the enigma-bbs directory");
}
if (err.hint) { if (err.hint) {
console.error(`Hint: ${err.hint}`); console.error(`Hint: ${err.hint}`);
} }
@@ -103,7 +99,6 @@ function main() {
console.error(`Note: ${err.configPath}`); console.error(`Note: ${err.configPath}`);
} }
} }
}
return callback(err); return callback(err);
}); });
}, },
@@ -134,7 +129,7 @@ function main() {
if (err && !errorDisplayed) { if (err && !errorDisplayed) {
console.error('Error initializing: ' + util.inspect(err)); console.error('Error initializing: ' + util.inspect(err));
return process.exit(); return process.exit(1);
} }
} }
); );