feat: support for custom PKG_NODE_PATH (#7)

This commit is contained in:
Daniel Lando 2023-10-17 08:50:13 +02:00 committed by GitHub
parent 62ffff231b
commit 4bfcccb9af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -115,3 +115,18 @@ review.
For example:
`yarn start --node-range node18 --arch x64 --output dist`
## Environment
| Var | Description |
| ---------------- | ------------------------------------------------------------------------------------------------------------ |
| `PKG_BUILD_PATH` | Directory to use to clone and build nodejs binaries. Default to system temporary directory |
| `PKG_CACHE_PATH` | Path to pkg-cache. Default to `~/.pkg-cache` |
| `PKG_IGNORE_TAG` | Ignore tag folder when checking local binary path |
| `PKG_NODE_PATH` | Custom path to the local nodejs binary to use |
| `HTTPS_PROXY` | Optional HTTPS proxy to use when fetching binaries |
| `HTTP_PROXY` | Optional HTTP proxy to use when fetching binaries |
| `MAKE_JOB_COUNT` | Number of parallel jobs when building binaries (value passed to `make -j` option). Default to number of cpus |
| `CFLAGS` | Flags to use when invoking C compiler |
| `CXXFLAGS` | Flags to use when invoking C++ compiler |
| `STRIP` | Path to `strip` command. Default to `strip` |

View File

@ -37,6 +37,10 @@ export function localPlace({
}: LocalPlaceOptions) {
let binDir: string;
if(process.env.PKG_NODE_PATH) {
return path.resolve(process.env.PKG_NODE_PATH);
}
if (output) {
binDir = path.resolve(output);
} else {