diff --git a/deno.json b/deno.json index c1d914b..d386052 100644 --- a/deno.json +++ b/deno.json @@ -7,7 +7,7 @@ "check-mods": "deno run --allow-read --allow-run tools/check_mods.ts", "pack-mod": "deno run --allow-read --allow-write --allow-run --allow-env tools/pack_mod.ts", "test": "deno test --allow-read --allow-write --allow-run tests/", - "desktop": "deno run -A build.ts --once && deno desktop --allow-read --allow-write --allow-net --allow-ffi --allow-env=BWORLD_SERVER,BWORLD_CLIENT_UPDATES,HOME,USERPROFILE,APPDATA,XDG_DATA_HOME --include build --include server_mods --include server/game/worker.ts --include desktop/config.json desktop/main.ts && deno run --allow-read --allow-write desktop/linux_launcher.ts dist/bworld" + "desktop": "deno run -A build.ts --once && deno desktop --allow-read --allow-write --allow-net --allow-ffi --allow-env=BWORLD_SERVER,BWORLD_CLIENT_UPDATES,HOME,USERPROFILE,APPDATA,XDG_DATA_HOME,DEBUG --include build --include server_mods --include server/game/worker.ts --include desktop/config.json desktop/main.ts && deno run --allow-read --allow-write desktop/linux_launcher.ts dist/bworld" }, "compilerOptions": { "lib": ["dom", "dom.asynciterable", "dom.iterable", "deno.ns", "deno.unstable", "deno.webgpu"] diff --git a/desktop/main.ts b/desktop/main.ts index 0f91100..bb2223a 100644 --- a/desktop/main.ts +++ b/desktop/main.ts @@ -77,6 +77,10 @@ win.addEventListener("close", async (event) => { Deno.exit(0); }); +if (Deno.env.get("DEBUG")) { + win.openDevtools(); +} + // deno desktop binds this to a private local address and opens the window on it, the port given here is ignored Deno.serve(async (req) => { const url = new URL(req.url);