move to correct structure

This commit is contained in:
JOLIMAITRE Matthieu 2023-12-09 00:08:48 +01:00
parent 44825c4c31
commit 54c4e91af8
12 changed files with 118 additions and 1 deletions

View file

@ -1,31 +0,0 @@
#!/bin/env -S deno run -A --unstable
import { daemon_send, new_cmd_disable, new_cmd_enable, new_cmd_status } from "./src/lib.ts";
import { socket_path } from "./src/lib/paths.ts";
await main();
async function main() {
const [kind, ...rest] = Deno.args;
if (kind === "status") {
const res = await daemon_send(socket_path(), new_cmd_status());
console.log({ res });
}
if (kind === "enable") {
const [name] = rest;
const res = await daemon_send(socket_path(), new_cmd_enable(name));
console.log({ res });
}
if (kind === "disable") {
const [name] = rest;
const res = await daemon_send(socket_path(), new_cmd_disable(name));
console.log({ res });
}
if (kind === "stop") {
const res = await daemon_send(socket_path(), new_cmd_status());
console.log({ res });
}
}