From e5a645ba51d9c63ca136b69a8fc4745b3ef4bbfd Mon Sep 17 00:00:00 2001 From: uki00a Date: Sun, 4 Jul 2021 16:24:35 +0900 Subject: [PATCH] feat: Update createNotifier to return SnoretoastNotifier on Windows --- mod.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod.ts b/mod.ts index b7f02ad..9f88346 100644 --- a/mod.ts +++ b/mod.ts @@ -2,6 +2,7 @@ import type { Notification, Notifier } from "./notifiers/notifier.ts"; import { normalizeNotification } from "./notifiers/util.ts"; import { OsascriptNotifier } from "./notifiers/osascript.ts"; import { NotifySendNotifier } from "./notifiers/notify_send.ts"; +import { SnoretoastNotifier } from "./notifiers/snoretoast.ts"; export type { Notification, Notifier }; @@ -20,13 +21,15 @@ export async function notify( } export function createNotifier(): Notifier { - // TODO: Add support for windows (Snarl, Windows 10 Toast Notifications) switch (Deno.build.os) { case "linux": return new NotifySendNotifier(); case "darwin": // TODO: Add support for `terminal-notifier` (https://github.com/julienXX/terminal-notifier) return new OsascriptNotifier(); + case "windows": + // TODO: Add support for Snarl and Windows 10 Toast Notifications + return new SnoretoastNotifier(); default: throw new Error("Not supported: " + Deno.build.os); }