From bd0878727036678eca984e754a1eeda9915f4042 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Fri, 1 Apr 2022 13:30:16 +0800 Subject: [PATCH] fix(cli): respect CARGO_BUILD_TARGET env variable --- cli/src/build.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cli/src/build.ts b/cli/src/build.ts index aa315284..344d61f7 100644 --- a/cli/src/build.ts +++ b/cli/src/build.ts @@ -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 ?? '', { - description: `Bypass to ${chalk.green('cargo build --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')}`,