Skip to content

Commit

Permalink
handle URL and NAME combination
Browse files Browse the repository at this point in the history
  • Loading branch information
urvishp80 authored and adamjonas committed Oct 30, 2023
1 parent 7ff52d7 commit b9d992a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions mailing-list/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,19 @@ const {
count
} = require("console");

const URL = process.env.URL || "https://lists.linuxfoundation.org/pipermail/bitcoin-dev/";
let URL = process.env.URL || "https://lists.linuxfoundation.org/pipermail/bitcoin-dev/";
let NAME = process.env.NAME || "bitcoin";

if (URL === "https://lists.linuxfoundation.org/pipermail/bitcoin-dev/") {
NAME = "bitcoin";
} else if (URL === 'https://lists.linuxfoundation.org/pipermail/lightning-dev/') {
NAME = "lightning";
}

console.log(
`NAME: ${NAME}\nURL: ${URL}`
);


const MONTHS = [
"January",
Expand Down Expand Up @@ -145,7 +157,7 @@ function parse_dumps() {
const fileDate = file.split("-")[0] + "-" + file.split("-")[1];
const fileName = file.split("-")[2];
const document = {
id: "mailing-list-" + process.env.NAME + '-' + file.replace(".html", ""),
id: "mailing-list-" + NAME + '-' + file.replace(".html", ""),
authors: [author],
title,
body: bodyText,
Expand Down

0 comments on commit b9d992a

Please sign in to comment.