From 1399288df5b16fd615b2b0a5a24f72ac602635a4 Mon Sep 17 00:00:00 2001 From: messense Date: Sat, 14 May 2022 15:03:31 +0800 Subject: [PATCH] feat(cli): allow specifying an alternative cargo binary via `CARGO` env var (#1181) --- cli/src/build.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/src/build.ts b/cli/src/build.ts index d70179e3..5a18a15a 100644 --- a/cli/src/build.ts +++ b/cli/src/build.ts @@ -258,7 +258,8 @@ export class BuildCommand extends Command { ] .filter((flag) => Boolean(flag)) .join(' ') - const cargoCommand = `cargo build ${externalFlags}` + const cargo = process.env.CARGO ?? 'cargo' + const cargoCommand = `${cargo} build ${externalFlags}` const intermediateTypeFile = join(tmpdir(), `type_def.${Date.now()}.tmp`) debug(`Run ${chalk.green(cargoCommand)}`) const additionalEnv = {}