-
Notifications
You must be signed in to change notification settings - Fork 34
Getting the location of the binary #46
Comments
Hi @egrogans-colinst, First, thanks for reaching out! I think that the best solution would be for caxa to introduce an environment variable containing the path of executable created with caxa before calling Node.js. For example, suppose that your file system looks like:
Then on the command line: $ pwd
/home/some-user/some/random/folders/
$ binary-created-with-caxa And from your Node.js program, the following would hold: process.env.CAXA_EXECUTABLE_PATH === "/usr/bin/binary-created-with-caxa" How does that sound? Do you think you could start a pull request for this? I think the work amounts to:
Other ideas I considered that didn’t make the cut:
|
Hi @cthayer-colinst, Thanks for using caxa and for the conversation here. I’ve been thinking about the broad strategy employed by caxa and concluded that there is a better way to solve the problem. It includes a It’s a different enough approach that I think it deserves a new name, and it’s part of a bigger toolset that I’m building, which I call Radically Straightforward · Package. I’m deprecating caxa and archiving this repository. I invite you to continue the conversation in Radically Straightforward’s issues. Best. |
My program requires a configuration file which is placed in the same directory as the executable, however the executable won't necessarily be executed from within that directory, it's intended to be a command-line utility placed in the PATH.
As a result, the
cwd
of the node environment will not be sufficient to be able to parse the config file.This is possible with pkg through the use of
process.execPath
, this returns the path to the node.exe in the caxa temp directory in a caxa package, however.I'm not certain how something along these lines would even be possible with caxa's design, but i've thought of the following two temporary solutions:
{{caxa}}
which can be used to pass the path to the executable into the commandThe text was updated successfully, but these errors were encountered: