Skip to content

Commit

Permalink
feat: Update createNotifier to return SnoretoastNotifier on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
uki00a committed Jul 4, 2021
1 parent d784220 commit e5a645b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand All @@ -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);
}
Expand Down

0 comments on commit e5a645b

Please sign in to comment.