[READ-ONLY] Mirror of https://github.com/FoxxMD/komodo-utilities. Small utilities to enhance Komodo
gotify komodo
0

Configure Feed

Select the types of activity you want to include in your feed.

refactor: Move env check to startup

FoxxMD (Nov 6, 2024, 8:55 AM EST) 8138e3fc 65f75211

+12 -11
+12 -11
gotify/main.ts
··· 1 1 import { Types } from "npm:komodo_client"; 2 2 import { gotify } from "npm:gotify@1.1.0"; 3 3 4 + const GOTIFY_APP_TOKEN: string = Deno.env.get('GOTIFY_APP_TOKEN') as string; 5 + if(GOTIFY_APP_TOKEN === Deno.env.get('GOTIFY_APP_TOKEN')) { 6 + console.error('GOTIFY_APP_TOKEN not defined in ENV'); 7 + Deno.exit(1); 8 + } 9 + 10 + const GOTIFY_URL: string = Deno.env.get('GOTIFY_URL') as string; 11 + if(GOTIFY_URL === undefined) { 12 + console.error('GOTIFY_URL not defined in ENV'); 13 + Deno.exit(1); 14 + } 15 + 4 16 async function handle_alert(alert: Types.Alert) { 5 - 6 - const GOTIFY_APP_TOKEN = Deno.env.get('GOTIFY_APP_TOKEN'); 7 - if(GOTIFY_APP_TOKEN === undefined) { 8 - console.error('GOTIFY_APP_TOKEN not defined in ENV'); 9 - return; 10 - } 11 - const GOTIFY_URL = Deno.env.get('GOTIFY_URL'); 12 - if(GOTIFY_URL === undefined) { 13 - console.error('GOTIFY_URL not defined in ENV'); 14 - return; 15 - } 16 17 17 18 const { 18 19 data: {