feat: add process.execpath to get the current lute executable
#431
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was trying to get the code generation to run through CMake (which would run lute in the build). When integrating this into luthier, I needed a way to identify the current lute executable to pass to CMake.
This adds
execpathto@lute/process, which mirrors Node.js' process.execPath to get the lute executable path - this is immune toexec -a foo lutehavingfooasargv[0].uv_setup_argscan allocate on some platforms. That memory should be free'd withuv_library_shutdown. I'm not sure where it's appropriate to call this.Passing around the
argv0also seems a bit wrong. Maybe this path shouldn't be stored inRuntime?