From 559653d751a3df94fdfac1cadc0f04e96d06827d Mon Sep 17 00:00:00 2001 From: Benjamin Pollack Date: Mon, 22 Nov 2021 16:24:46 -0500 Subject: [PATCH] better naming --- dortune.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dortune.ts b/dortune.ts index 450a782..22b79d4 100755 --- a/dortune.ts +++ b/dortune.ts @@ -1,14 +1,14 @@ #!/usr/bin/env deno run --allow-read=. -async function fileFortunes(name: string): Promise { +async function readFortunes(name: string): Promise { const resp = await fetch(new URL(`./${name}`, import.meta.url)); return (await resp.text()).split("%").slice(1); } -const fortunes = await fileFortunes("freebsd.fortunes"); +const fortunes = await readFortunes("freebsd.fortunes"); if (Deno.args.some((a) => a == "-o" || a == "--offensive")) { - fortunes.push(...await fileFortunes("offensive.fortunes")); + fortunes.push(...await readFortunes("offensive.fortunes")); } console.log(fortunes[Math.floor(Math.random() * fortunes.length)].trim()); -- 2.45.2