Bug Fixes and Extra Checks
I had set an emoji to emoji.thumb_down when it doesn't exist. Changed to emoji.heavy_check, I even used the wrong one for the context! Added extra checks for the image directory to make sure it exists before continuing.
This commit is contained in:
parent
1b54c54b83
commit
bbdb115f7a
1 changed files with 8 additions and 3 deletions
11
index.js
11
index.js
|
@ -7,11 +7,10 @@ internals = {
|
|||
c:"WARN"
|
||||
}
|
||||
};
|
||||
let dE = new Date(), startTime = dE.getTime(), endTime, modules = [], img_json;
|
||||
let dE = new Date(), startTime = dE.getTime(), endTime, modules = [], image_json;
|
||||
|
||||
// Clear console before printing anything
|
||||
console.clear();
|
||||
|
||||
fs.readFile('./misc/ascii.txt', function(err, data) {
|
||||
if (err) throw err;
|
||||
fs.readdir(config.server.image_dir, (err, files) => {
|
||||
|
@ -44,12 +43,18 @@ fs.readFile('./misc/ascii.txt', function(err, data) {
|
|||
if (error) {
|
||||
fs.writeFile('./image-type.json', '{\n\}', function(err) {
|
||||
if (err) throw err;
|
||||
modules.logger.log(internals.types.a, emoji.thumb_down, "Created image-type File!");
|
||||
modules.logger.log(internals.types.a, emoji.heavy_check, "Created image-type File!");
|
||||
image_json = require("./image-type.json");
|
||||
});
|
||||
} else {
|
||||
image_json = require("./image-type.json");
|
||||
}
|
||||
});
|
||||
fs.access(config.server.image_dir, error => {
|
||||
if (error) {
|
||||
fs.mkdirSync(config.server.image_dir);
|
||||
}
|
||||
});
|
||||
modules.logger.log(internals.types.a, emoji.wave, "Starting Revolution...");
|
||||
server();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue