Merge pull request #535 from DeMoorJasper/tweak-build-command

This commit is contained in:
LongYinan 2021-04-19 01:20:48 +08:00 committed by GitHub
commit d5192e05a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -66,6 +66,8 @@ If not set, cli will read the `package.name` field in `Cargo.toml` under `proces
> default `undefined`
You can also define this value using the `RUST_TARGET` environment variable.
This value will be passed to `Cargo build` command directly. eg: `napi build --target x86_64-unknown-linux-musl`
#### `--cargo-flags`
@ -74,6 +76,12 @@ This value will be passed to `Cargo build` command directly. eg: `napi build --t
Other flags you want pass to `Cargo build`.
#### `--cargo-cwd`
> default `undefined`
This flag can be used to build binaries that are not in the current directory. The path that is passed to this flag should be relative to the current directory.
### `napi artifacts`
> Copy artifact files in Github actions.

View file

@ -30,7 +30,7 @@ export class BuildCommand extends Command {
cargoName?: string
@Command.String('--target')
targetTripleDir = ''
targetTripleDir = process.env.RUST_TARGET ?? ''
@Command.String('--features')
features?: string