convert index.js to tabs (4) instead of spaces

This commit is contained in:
Holly Stubbs 2022-01-07 06:38:56 +00:00
parent 0f6828d44b
commit 53bf425bd3
Signed by: tgpholly
GPG key ID: B8583C4B7D18119E

View file

@ -9,7 +9,7 @@ class reqMod {
this.status = status;
}
}
// Array containing a list of required modules and their flags
// List containing a list of required modules and their flags
const requiredModules = [
new reqMod("handle_console", false)
];
@ -22,7 +22,7 @@ if (fs.existsSync("./config/config.json")) {
} else {
console.log("[Config] Config file doesn't exist! You probably haven't copied the example config in the config directory.");
console.log("[Config] Exiting...");
// It doesn't exist, exit the framework and tell the user what to do
// It doesn't exist, exit Revolution and tell the user what to do
process.exit(1);
}
global.actualDir = __dirname;
@ -31,10 +31,8 @@ global.internals = {
};
global.app = express();
global.modules = [];
let dE = new Date(),
// Get the time at invocation
startTime = dE.getTime(),
endTime,
let startTime = Date.now(),
reqhandler;
// Clear console before printing anything
@ -52,7 +50,7 @@ fs.readFile('./misc/ascii.txt', function(err, data) {
if (err) throw err;
for (var i = 0; i < files.length; i++) {
/*
For every file in the array, output that it was found
For every file in the list, output that it was found
in the console and attempt to load it using require.
Oh, and check that it has .js in it's file name!
*/
@ -91,7 +89,7 @@ fs.readFile('./misc/ascii.txt', function(err, data) {
// Check if all the required modules flags are set
let allRequiredExist = [];
for (var i = 0; i < requiredModules.length; i++) {
// Push the status of the required modules to an array
// Push the status of the required modules to an list
allRequiredExist.push(requiredModules[i].status);
}
// Make sure all required modules are found
@ -99,10 +97,10 @@ fs.readFile('./misc/ascii.txt', function(err, data) {
// Inform the user that not all required modules are found.
console.log("[Modules] All required modules could not be found.");
console.log("[Modules] Server will not start until all required modules are found.");
// They are not all found, exit framework with code 1.
// They are not all found, exit Revolution with code 1.
process.exit(1);
} else {
// All required modules are found, start the framework's server.
// All required modules are found, start Revolution's server.
global.modules.consoleHelper.printInfo(emoji.wave, "Starting Revolution...");
if (reqhandler == null) {
global.modules.consoleHelper.printError(emoji.cross, "No request handler was loaded, possibly due to an error.");
@ -128,10 +126,8 @@ async function start() {
});
// Start the server listening at the port defined in the config file
app.listen(config.server.port, () => {
dE = new Date(),
// Get time after server has started listening or the "end time".
endTime = dE.getTime();
global.modules.consoleHelper.printInfo(emoji.thumb_up, `Started Revolution on port ${config.server.port}! Took ${endTime - startTime}ms`);
global.modules.consoleHelper.printInfo(emoji.thumb_up, `Started Revolution on port ${config.server.port}! Took ${Date.now() - startTime}ms`);
});
}