Check before deleting rankurl.txt

This commit is contained in:
CakeLancelot 2020-12-22 12:00:44 -06:00
parent a73b3a4b3f
commit fab7d53150

View File

@ -75,8 +75,10 @@ function setGameInfo(serverUUID) {
console.log("Using rank endpoint " + rankurl) console.log("Using rank endpoint " + rankurl)
remotefs.writeFileSync(__dirname+"\\rankurl.txt", rankurl); remotefs.writeFileSync(__dirname+"\\rankurl.txt", rankurl);
} else { } else {
if (remotefs.existsSync(__dirname+"\\rankurl.txt")) {
// delete the file, this server won't be using it // delete the file, this server won't be using it
remotefs.unlinkSync(__dirname+"\\rankurl.txt") remotefs.unlinkSync(__dirname+"\\rankurl.txt");
}
} }
} }