Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bbs.js to for Config Init Enhancements #574

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 12 additions & 17 deletions core/bbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,18 @@ function main() {
// then it's a fatal error
//
if (err) {
errorDisplayed = true;
console.error(`Configuration error: ${err.message}`); // eslint-disable-line no-console

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;
console.error(`Configuration error: ${err.message}`); // eslint-disable-line no-console
if (err.hint) {
console.error(`Hint: ${err.hint}`);
}
if (err.configPath) {
console.error(`Note: ${err.configPath}`);
}
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");
NuSkooler marked this conversation as resolved.
Show resolved Hide resolved
}

if (err.hint) {
console.error(`Hint: ${err.hint}`);
}
if (err.configPath) {
console.error(`Note: ${err.configPath}`);
}
}
return callback(err);
Expand Down Expand Up @@ -134,7 +129,7 @@ function main() {

if (err && !errorDisplayed) {
console.error('Error initializing: ' + util.inspect(err));
return process.exit();
return process.exit(1);
}
}
);
Expand Down