Modified automatic permissions for json files

This commit is contained in:
Isaac Grynsztein
2020-04-15 03:36:56 -04:00
parent 2408184cc7
commit 264b3606d6

View File

@@ -742,10 +742,10 @@ function getJSONMp4(name, customPath = null, openReadPerms = false)
if (fs.existsSync(jsonPath)) if (fs.existsSync(jsonPath))
{ {
obj = JSON.parse(fs.readFileSync(jsonPath, 'utf8')); obj = JSON.parse(fs.readFileSync(jsonPath, 'utf8'));
if (openReadPerms) fs.chmodSync(jsonPath, 0o755); if (openReadPerms) fs.chmodSync(jsonPath, 0o644);
} else if (fs.existsSync(alternateJsonPath)) { } else if (fs.existsSync(alternateJsonPath)) {
obj = JSON.parse(fs.readFileSync(alternateJsonPath, 'utf8')); obj = JSON.parse(fs.readFileSync(alternateJsonPath, 'utf8'));
if (openReadPerms) fs.chmodSync(alternateJsonPath, 0o755); if (openReadPerms) fs.chmodSync(alternateJsonPath, 0o644);
} }
else obj = 0; else obj = 0;
return obj; return obj;