Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
77b8e9e368 | |||
18eb34c1ea | |||
c683d5d254 | |||
1d9eb32901 | |||
f3a6a16a7b | |||
af7ae54128 | |||
da214bf8f9 | |||
07aabc16fc | |||
a9228fd09a |
@ -6,6 +6,7 @@ on:
|
|||||||
branches: main
|
branches: main
|
||||||
jobs:
|
jobs:
|
||||||
validate:
|
validate:
|
||||||
|
name: Validate
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read # Needed to clone the repository
|
contents: read # Needed to clone the repository
|
||||||
|
@ -11,27 +11,27 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install Deno
|
- name: Install Deno
|
||||||
uses: denoland/setup-deno@v1
|
uses: denoland/setup-deno@v1
|
||||||
with:
|
with:
|
||||||
deno-version: v1.x
|
deno-version: v1.x
|
||||||
|
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '>=1.20.1'
|
||||||
|
|
||||||
- name: Compile
|
- name: Compile
|
||||||
run: "deno task compile"
|
run: "deno task compile"
|
||||||
|
|
||||||
- name: Test ls
|
|
||||||
run: "ls"
|
|
||||||
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: "https://gitea.com/actions/upload-artifact@v3"
|
|
||||||
with:
|
|
||||||
name: bunker-artifact
|
|
||||||
path: bunker
|
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: ncipollo/release-action@v1
|
id: use-go-action
|
||||||
|
uses: "https://gitea.com/actions/release-action@main"
|
||||||
with:
|
with:
|
||||||
artifacts: "bunker"
|
files: "bunker"
|
||||||
|
api_key: '${{secrets.GITEA_TOKEN}}'
|
||||||
|
|
||||||
|
|
||||||
|
12
main.ts
12
main.ts
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user