canvacord-assets
Advanced tools
Comparing version 1.0.9 to 1.1.0
15
index.js
const fs = require("fs"); | ||
const chalk = require("chalk"); | ||
const dir = { | ||
@@ -16,10 +15,7 @@ IMAGES: `${__dirname}/data/images`, | ||
console.log(chalk.blueBright("[Canvacord] Loading assets...")); | ||
// load images | ||
fs.readdir(dir.IMAGES, (error, files) => { | ||
console.log(chalk.blueBright("[Canvacord] Loading images...")); | ||
if (error) console.log(chalk.redBright(`[Canvacord] Error while loading assets: ${error.message}!`)); | ||
if (error) console.error(`[Canvacord] Error while loading assets: ${error.message}!`); | ||
if (!files.length) return console.log(chalk.redBright("[Canvacord] Assets dir is corrupted, please re-install canvacord.")); | ||
if (!files.length) throw new Error("[Canvacord] Assets dir is corrupted, please re-install canvacord."); | ||
@@ -29,3 +25,2 @@ files.forEach((x, i) => { | ||
obj.images[name] = `${dir.IMAGES}/${x}`; | ||
console.log(chalk.greenBright(`[${i+1}] Loaded image ${x}!`)); | ||
}); | ||
@@ -36,6 +31,5 @@ }); | ||
fs.readdir(dir.FONTS, (error, files) => { | ||
console.log(chalk.blueBright("[Canvacord] Loading fonts...")); | ||
if (error) console.log(chalk.redBright(`[Canvacord] Error while loading assets: ${error.message}!`)); | ||
if (error) console.error(`[Canvacord] Error while loading assets: ${error.message}!`); | ||
if (!files.length) return console.log(chalk.redBright("[Canvacord] Assets dir is corrupted, please re-install canvacord.")); | ||
if (!files.length) throw new Error("[Canvacord] Assets dir is corrupted, please re-install canvacord."); | ||
@@ -45,3 +39,2 @@ files.forEach((x, i) => { | ||
obj.fonts[name] = `${dir.FONTS}/${x}`; | ||
console.log(chalk.greenBright(`[${i+1}] Loaded font ${x}!`)); | ||
}); | ||
@@ -48,0 +41,0 @@ }); |
{ | ||
"name": "canvacord-assets", | ||
"version": "1.0.9", | ||
"version": "1.1.0", | ||
"description": "Canvacord assets", | ||
@@ -12,5 +12,3 @@ "main": "index.js", | ||
"license": "MIT", | ||
"dependencies": { | ||
"chalk": "^4.1.0" | ||
}, | ||
"dependencies": {}, | ||
"directories": { | ||
@@ -17,0 +15,0 @@ "test": "test" |
0
3797965
45
- Removedchalk@^4.1.0
- Removedansi-styles@4.3.0(transitive)
- Removedchalk@4.1.2(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedsupports-color@7.2.0(transitive)