output sqlite3
All checks were successful
Release / build (push) Successful in 34s
Integration / Validate (push) Successful in 7s

This commit is contained in:
SimonFJ20 2024-09-26 03:13:40 +02:00
parent 18eb34c1ea
commit 77b8e9e368

12
main.ts
View File

@ -27,14 +27,20 @@ try {
if (!(error instanceof Deno.errors.NotFound)) { if (!(error instanceof Deno.errors.NotFound)) {
throw error; throw error;
} }
console.log("'bunker.db' not found, creating...");
const cmd = new Deno.Command("sqlite3", { const cmd = new Deno.Command("sqlite3", {
args: ["bunker.db", ".read database.sql"], args: ["bunker.db", ".read database.sql"],
stdout: "piped", stdout: "piped",
stderr: "piped", stderr: "piped",
}); });
console.log( const cmdChild = cmd.spawn();
await cmd.output().then((out) => new TextDecoder().decode(out.stdout)), cmdChild.stdout.pipeTo(Deno.stdout.writable);
); cmdChild.stderr.pipeTo(Deno.stderr.writable);
const status = await cmdChild.status;
if (!status.success) {
console.log("failed creating 'bunker.db', exiting...");
Deno.exit(1);
}
} }
class SqliteDb implements Db { class SqliteDb implements Db {