jeiea
jeiea

Reputation: 2405

How to get absolute path of compiled deno executable?

I want to get executable (artifact from deno compile) path in script.

I tried import.meta.url, Deno.mainModule and Deno.args but none of them works.

import.meta.url didn't changed even if executable location was changed.

Deno.mainModule was always file://$deno$/bundle.js.

Deno.args doesn't contain first parameter(which is executable).

What should I use?

Upvotes: 4

Views: 1359

Answers (1)

jsejcksn
jsejcksn

Reputation: 33796

You can use Deno.execPath() which requires allow-read permission.

Upvotes: 4

Related Questions