mirror of
https://github.com/tiennm99/is-a-good-dev.git
synced 2026-10-13 10:15:49 +00:00
Clean up.
This commit is contained in:
1 parent
c661b0f63c
commit
dd89fade4d
1 file changed
+4
-2
+4
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user