Skip to content

Commit

Permalink
fix: do not die on DEBUG variable env permissions not granted (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlighter authored Oct 30, 2024
1 parent daf8b07 commit a0c3931
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/debug.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/** Whether to enable debug logging. */
export const DEBUG = !!Deno.env.get("DEBUG");
export const DEBUG =
(Deno.permissions.querySync({ name: "env", variable: "DEBUG" }).state ===
"granted") && (!!Deno.env.get("DEBUG"));

/** Attach a websocket to the console for debugging. */
export function attachWs(ws: WebSocket) {
Expand Down

0 comments on commit a0c3931

Please sign in to comment.