Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
77b8e9e368 | |||
18eb34c1ea | |||
c683d5d254 | |||
1d9eb32901 | |||
f3a6a16a7b | |||
af7ae54128 | |||
da214bf8f9 | |||
07aabc16fc | |||
a9228fd09a | |||
5803981615 | |||
68f40fb0e5 | |||
2ab9e98751 | |||
d604f8d727 | |||
5d6af2aa21 | |||
d3387cbad1 | |||
42513e5f8b |
@ -6,6 +6,7 @@ on:
|
||||
branches: main
|
||||
jobs:
|
||||
validate:
|
||||
name: Validate
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read # Needed to clone the repository
|
||||
|
@ -11,21 +11,27 @@ jobs:
|
||||
steps:
|
||||
- name: Clone
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Deno
|
||||
uses: denoland/setup-deno@v1
|
||||
with:
|
||||
deno-version: v1.x
|
||||
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '>=1.20.1'
|
||||
|
||||
- name: Compile
|
||||
run: "deno task compile"
|
||||
|
||||
- name: Test ls
|
||||
run: "ls"
|
||||
|
||||
- name: Release
|
||||
uses: ncipollo/release-action@v1
|
||||
id: use-go-action
|
||||
uses: "https://gitea.com/actions/release-action@main"
|
||||
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)) {
|
||||
throw error;
|
||||
}
|
||||
console.log("'bunker.db' not found, creating...");
|
||||
const cmd = new Deno.Command("sqlite3", {
|
||||
args: ["bunker.db", ".read database.sql"],
|
||||
stdout: "piped",
|
||||
stderr: "piped",
|
||||
});
|
||||
console.log(
|
||||
await cmd.output().then((out) => new TextDecoder().decode(out.stdout)),
|
||||
);
|
||||
const cmdChild = cmd.spawn();
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user