I am trying to get the directory in which my executable is located so I can access certain directories relative to it. When I do something like
const executionDirectory = path.resolve(import.meta.dir)
, I get /$bunfs/root
And there are no files in this directory.
const executionDirectory = __dirname
gives me the source directory but not where the executable is located.
The solution I found is
const executionDirectory = process.execPath.split('/').slice(0, -1).join('/')
This seems to do the trick. If there is a better way – please let me know.