fix broken relitive dir
This commit is contained in:
parent
d16c2594e2
commit
9afe4a2b81
1 changed files with 2 additions and 2 deletions
4
stats.js
4
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue