added checks for old filenames

This commit is contained in:
Viet Huynh
2023-09-18 02:51:49 +07:00
parent abd7d1c852
commit 565e2e6d4d
2 changed files with 9 additions and 2 deletions
+2
View File
@@ -9,6 +9,8 @@ lerna-debug.log*
# CGPS
output
input.csv
whitelist.csv
blocklist.txt
allowlist.txt
+7 -2
View File
@@ -1,3 +1,4 @@
import { existsSync } from "fs";
import { resolve } from "path";
import {
@@ -18,8 +19,12 @@ import {
readFile,
} from "./lib/utils.js";
const allowlistFilename = "allowlist.txt";
const blocklistFilename = "blocklist.txt";
const allowlistFilename = existsSync("whitelist.csv")
? "whitelist.csv"
: "allowlist.txt";
const blocklistFilename = existsSync("input.csv")
? "input.csv"
: "blocklist.txt";
const allowlist = new Map();
const blocklist = new Map();
const domains = [];