From 2dbcab998f0f0aa7e5f6de11389ea017cabdb701 Mon Sep 17 00:00:00 2001 From: Zichao Lin Date: Fri, 20 Oct 2023 22:42:54 +0800 Subject: [PATCH] only read files end with json --- src/config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config.js b/src/config.js index c2a15ce..4c87f0b 100644 --- a/src/config.js +++ b/src/config.js @@ -79,6 +79,7 @@ exports.getGlobalConfig = function () { exports.getConfigs = function () { try { var configsList = fs.readdirSync("configs"); + configsList = configsList.filter((file) => file.endsWith(".json")); } catch (e) { if ( e == "Error: ENOENT: no such file or directory, scandir 'configs'"