Skip to content

Commit

Permalink
yay, compile to .exe
Browse files Browse the repository at this point in the history
  • Loading branch information
nulta committed Oct 8, 2024
1 parent 8199421 commit ecce3fc
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
Empty file added bin/.gitkeep
Empty file.
Binary file added bin/killer
Binary file not shown.
Binary file added bin/killer.exe
Binary file not shown.
7 changes: 7 additions & 0 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# windows
deno compile --output=./bin/killer.exe --allow-net --allow-env=INTERCEPTOR_EXIT_ON_NEW_VERSION --allow-read=config.json --allow-write=config.json --target=x86_64-pc-windows-msvc local.ts

# current platform
deno compile --output=./bin/killer --allow-net --allow-env=INTERCEPTOR_EXIT_ON_NEW_VERSION --allow-read=config.json --allow-write=config.json local.ts
30 changes: 28 additions & 2 deletions local.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
import * as cfg from "./config.json" with {type: "json"}

console.log("[Loader] Loading the local script. No automatic update.")
let cfg: {default: any}
try {
const cfgData = JSON.parse(await Deno.readTextFile("./config.json"))
cfg = {default: cfgData}
} catch (e) {
const configContent = `{
"Mastodon": false,
"Misskey": false,
"Misskey_ShouldBanUser": true,
"Site": "https://instancename.example.com/",
"ApiKey": "???????"
}
`

console.error("[Loader] Failed to find configuration file.")
console.error("[Loader] Creating 'config.json'. Please check!")
await Deno.writeTextFile(
"./config.json",
configContent
)
Deno.exit(1)
}

console.log("[Loader] Loading the local script...")
console.log("[Loader] Version", 9)

Deno.env.delete("INTERCEPTOR_EXIT_ON_NEW_VERSION")

const module = await import("./core/main.ts")
Expand Down

0 comments on commit ecce3fc

Please sign in to comment.