feat(cli): allow specifying an alternative cargo binary via CARGO env var (#1181)

This commit is contained in:
messense 2022-05-14 15:03:31 +08:00 committed by GitHub
parent d6c755c4eb
commit 1399288df5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -258,7 +258,8 @@ export class BuildCommand extends Command {
] ]
.filter((flag) => Boolean(flag)) .filter((flag) => Boolean(flag))
.join(' ') .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`) const intermediateTypeFile = join(tmpdir(), `type_def.${Date.now()}.tmp`)
debug(`Run ${chalk.green(cargoCommand)}`) debug(`Run ${chalk.green(cargoCommand)}`)
const additionalEnv = {} const additionalEnv = {}