Reputation: 2405
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
Reputation: 33796
You can use Deno.execPath()
which requires allow-read
permission.
Upvotes: 4