add cwd docs and RUST_TARGET

This commit is contained in:
Jasper De Moor 2021-04-18 17:52:28 +02:00
parent 00aa4ad632
commit 27a8581d1d
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` > 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` This value will be passed to `Cargo build` command directly. eg: `napi build --target x86_64-unknown-linux-musl`
#### `--cargo-flags` #### `--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`. 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` ### `napi artifacts`
> Copy artifact files in Github actions. > Copy artifact files in Github actions.

View file

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