fix main call

This commit is contained in:
JOLIMAITRE Matthieu 2024-02-03 21:02:50 +01:00
parent a20745f38d
commit 686ed543ab

View file

@ -7,7 +7,6 @@ import { log_from, sleep } from "./src/lib/utils.ts";
const log = log_from("daemon"); const log = log_from("daemon");
if (import.meta.main) await main();
async function main() { async function main() {
const state = await State.load(); const state = await State.load();
const server = await daemon_listen(socket_path()); const server = await daemon_listen(socket_path());
@ -141,3 +140,5 @@ function termination_function(state: State, server: Deno.Listener<Deno.Conn>) {
Deno.exit(0); Deno.exit(0);
}; };
} }
if (import.meta.main) await main();