fix(cli): respect CARGO_BUILD_TARGET env variable

This commit is contained in:
LongYinan 2022-04-01 13:30:16 +08:00
parent 11967dec79
commit bd08787270
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7

View file

@ -88,9 +88,13 @@ export class BuildCommand extends Command {
)} field in ${chalk.underline(chalk.yellowBright('Cargo.toml'))}`,
})
targetTripleDir = Option.String('--target', process.env.RUST_TARGET ?? '', {
targetTripleDir = Option.String(
'--target',
process.env.RUST_TARGET ?? process.env.CARGO_BUILD_TARGET ?? '',
{
description: `Bypass to ${chalk.green('cargo build --target')}`,
})
},
)
features?: string = Option.String('--features', {
description: `Bypass to ${chalk.green('cargo build --features')}`,