1
0
Fork 0
forked from svrjs/svrjs

Replace __dirname with process.dirname

This commit is contained in:
Dorian Niemiec 2024-08-26 07:05:04 +02:00
parent 9b8ccd31fc
commit 1fbede69e5

View file

@ -215,10 +215,10 @@ const {
process.serverConfig = {}; process.serverConfig = {};
let configJSONRErr = undefined; let configJSONRErr = undefined;
let configJSONPErr = undefined; let configJSONPErr = undefined;
if (fs.existsSync(__dirname + "/config.json")) { if (fs.existsSync(process.dirname + "/config.json")) {
let configJSONf = ""; let configJSONf = "";
try { try {
configJSONf = fs.readFileSync(__dirname + "/config.json"); // Read JSON File configJSONf = fs.readFileSync(process.dirname + "/config.json"); // Read JSON File
try { try {
process.serverConfig = JSON.parse(configJSONf); // Parse JSON process.serverConfig = JSON.parse(configJSONf); // Parse JSON
} catch (err2) { } catch (err2) {