From 9afe4a2b81fce3229be859c45832a0b53197e1df Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Mon, 16 Sep 2024 14:00:54 -0500 Subject: [PATCH] fix broken relitive dir --- stats.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stats.js b/stats.js index 192780e..0200a65 100644 --- a/stats.js +++ b/stats.js @@ -3,7 +3,7 @@ const fs=require("node:fs"); let uptimeObject={}; if(fs.existsSync("./uptime.json")){ try{ - uptimeObject=JSON.parse(fs.readFileSync("./uptime.json", "utf8")); + uptimeObject=JSON.parse(fs.readFileSync(__dirname+"/uptime.json", "utf8")); }catch{ uptimeObject={}; } @@ -173,7 +173,7 @@ function setStatus(instance,status){ } } function updatejson(){ - fs.writeFile("./uptime.json",JSON.stringify(uptimeObject),_=>{}); + fs.writeFile(__dirname+"/uptime.json",JSON.stringify(uptimeObject),_=>{}); } exports.observe=observe; exports.uptime=uptimeObject;