[go: up one dir, main page]

Replace $NODE reference at start of command with value of process.execPath

Currently, Collector will look for the string node at the start of the command and replace it with the value of process.execPath (the current Node.js executable path). However, this implicit behavior does not allow the user to control which Node.js executable is used. Instead, Collector should look for and replace the pseudo-environment variable reference $NODE at the start of the command. Collector should also ensure that the NODE environment variable is set when running the command. If the environment variable was already set, Collector should use the existing value (to allow it to be overridden).

Replacing the environment variable reference $NODE in the command does not equate to running the command in a shell or supporting environment variable references elsewhere in the command (at least for now). Rather, it's a way to communicate to Collector that the path to the Node.js executable should be inherited from the Antora process.

If the command starts with the path of a JavaScript file, the value of the NODE environment variable will still be prepended to the command.