diff --git a/gui/src-tauri/Cargo.toml b/gui/src-tauri/Cargo.toml index 55bfee5..bb990f2 100644 --- a/gui/src-tauri/Cargo.toml +++ b/gui/src-tauri/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" tauri-build = { version = "1.2", features = [] } [dependencies] -tauri = { version = "1.2", features = ["shell-open", "shell-sidecar", "window-all"] } +tauri = { version = "1.2", features = ["shell-execute", "shell-open", "shell-sidecar", "window-all"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/gui/src-tauri/tauri.conf.json b/gui/src-tauri/tauri.conf.json index 6598587..7261850 100644 --- a/gui/src-tauri/tauri.conf.json +++ b/gui/src-tauri/tauri.conf.json @@ -15,6 +15,7 @@ "all": false, "shell": { "sidecar": true, + "execute": true, "scope": [ { "name": "../binaries/s3si", @@ -22,6 +23,16 @@ "args": [ "--daemon" ] + }, + { + "name": "deno", + "cmd": "deno", + "args": [ + "run", + "-A", + "../../s3si.ts", + "--daemon" + ] } ], "all": false, diff --git a/gui/src/ipc/stdio.ts b/gui/src/ipc/stdio.ts index 2ff3e02..84481c9 100644 --- a/gui/src/ipc/stdio.ts +++ b/gui/src/ipc/stdio.ts @@ -15,10 +15,13 @@ export class IPC { child: Promise; constructor() { - const command = Command.sidecar('../binaries/s3si', ['--daemon']); + const command = import.meta.env.DEV ? new Command("deno", ["run", "-A", "../../s3si.ts", "--daemon"]) : Command.sidecar('../binaries/s3si', ['--daemon']); command.stdout.on('data', line => { this.callback(JSON.parse(line)) }) + command.stderr.on('data', line => { + console.error('daemon stderr', line) + }) this.child = command.spawn() }