add langs 2021

This commit is contained in:
Thomas Ruoff
2021-12-01 22:27:20 +01:00
parent 6885dd1afc
commit ff048bfb51
2 changed files with 19 additions and 3 deletions

View File

@@ -53,7 +53,7 @@ function read() {
const run = async () => {
const people = await read();
const dryRun = process.argv[2] === "--dry";
const send = process.argv[2] === "--send";
if (!people || !people.length) {
throw new Error("input file empty");
@@ -83,8 +83,8 @@ const run = async () => {
people.map(({ name, pick }) => `${name} picked ${pick}`).join("\n")
);
if (dryRun) {
console.log("DryRun: did not send emails");
if (!send) {
console.log("DryRun: did not send emails. To send pass --send option");
return;
}
people.forEach(p => mail(p.email, p.name, p.pick));