Clean up.

This commit is contained in:
Tweak authored and GitHub committed 2022-09-07 09:57:51 -06:00
1 parent c661b0f63c
commit dd89fade4d
1 file changed
+4 -2
+4 -2
View File
@@ -3,8 +3,10 @@ function getFileExtension(filename) {
return (/[.]/.exec(filename)) ? /[^.]+$/.exec(filename) : undefined;
}
function getJSON(file) {
const path = `${process.env.actions_path}/${file}`; //json file path
if (!getFileExtension(file) | getFileExtension(file) != "json") return false; //if no file extension, or file extension is not json, return.
const path = `${process.env.actions_path}/${file}`; //json file path.
const ext = getFileExtension(file)
if (!ext) return false; //if no file extension, return.
if (ext != "json") return false; //if file extension is not ".json" return.
try {
if (fs.existsSync(path)) { //check if file exists in domain directory
//it exists