Skip to content
Discussion options

You must be logged in to vote

I had a similar need for embedding executables as I am experimenting bundling a small webview executable with my Deno application. The workaround I came up with is to first write the executable to the filesystem before running Deno.Command.

const file = Deno.readFileSync(import.meta.dirname + "/webview/build/bin/webview-linux-x86_64")
Deno.writeFileSync(`/tmp/webview`, file, { mode: 0o755 })
new Deno.Command(`/tmp/webview`).spawn()

Alternative example using file stream

const file = await Deno.open(import.meta.dirname + "/webview/build/bin/webview-linux-x86_64")
await Deno.writeFile("/tmp/webview", file.readable, { mode: 0o755 })
new Deno.Command("/tmp/webview").spawn()

Reminder to --include

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nashaddams
Comment options

Answer selected by nashaddams
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants