From 9b67506558390b5e20fa921f4b61b2d0415236ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Wed, 16 Jun 2021 04:49:45 +0300 Subject: [PATCH] Removed static directory address in datastore.js --- src/client/datastore.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/datastore.js b/src/client/datastore.js index 7d94ee4..f6cd119 100644 --- a/src/client/datastore.js +++ b/src/client/datastore.js @@ -9,10 +9,10 @@ module.exports = class { loadData() { //console.log(""); - const dataFiles = fs.readdirSync("D:/GitHub/eximiabots-radiox/datastore"/*path.join(path.dirname(__dirname), 'datastore')*/).filter(f => f.endsWith('.json')); + const dataFiles = fs.readdirSync(path.join(path.dirname(__dirname), '../datastore')).filter(f => f.endsWith('.json')); for (const file of dataFiles) { try { - const json = require(`../../datastore/${file}`); + const json = require(`../../../datastore/${file}`); this.map.set(json.guild.id, json); //console.log('[LOADED] ' + file + " (" + json.guild.id + ")"); //console.log(JSON.stringify(json, null, 4)); @@ -115,7 +115,7 @@ module.exports = class { saveEntry(file, data) { data = JSON.stringify(data, null, 4); - fs.writeFile(path.join(path.dirname(__dirname), 'datastore') + "/" + file + ".json", data, 'utf8', function(err) { + fs.writeFile(path.join(path.dirname(__dirname), '../datastore') + "/" + file + ".json", data, 'utf8', function(err) { if (err) { //console.log(err); }