From: The Block List Project <66567751+blocklistproject@users.noreply.github.com> Date: Fri, 11 Jun 2021 13:03:29 +0000 (-0500) Subject: Delete generate-dnsmasq.js X-Git-Tag: aggregated-20250518~575^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86f1fe7a5bc8cdf7654c8f3f5390300e34c0fc8d;p=thirdparty%2Fblocklistproject%2Flists.git Delete generate-dnsmasq.js --- diff --git a/scripts/generate-dnsmasq.js b/scripts/generate-dnsmasq.js deleted file mode 100644 index 6ac3fbe..0000000 --- a/scripts/generate-dnsmasq.js +++ /dev/null @@ -1,15 +0,0 @@ -const fs = require("fs").promises; -const path = require("path"); - -(async () => { - const files = (await fs.readdir(path.join(__dirname, ".."))).filter((file) => file.endsWith(".txt")); // Array of strings, each representing a single file that ends in `.txt` - await Promise.all(files.map(async (file) => { // For each file - const fileContents = await fs.readFile(path.join(__dirname, "..", file), "utf8"); // Get file contents as a string - const noIPFileContents = fileContents - .replaceAll(/^0\.0\.0\.0 /gmu, "server=/") // Replace all occurances of "0.0.0.0 " at the beginning of the line with "server=/" - .replaceAll(/^# 0\.0\.0\.0 /gmu, "# server=/") // Replace all occurances of "# 0.0.0.0 " at the beginning of the line with "# server=/" - // .replaceAll(/^# 0\.0\.0\.0 /gmu, "# server=/") // I need this line to add "/" at the end of each URL - .replace(/^# Title: (.*?)$/gmu, "# Title: $1 (NL)"); // Add (NL) to end of title - await fs.writeFile(path.join(__dirname, "..", "alt-version", file.replace(".txt", "-nl.txt")), noIPFileContents, "utf8"); // Write new file to `alt-version` directory - })); -})();