diff --git a/cli/src/build.ts b/cli/src/build.ts index f38db7af..48861d6e 100644 --- a/cli/src/build.ts +++ b/cli/src/build.ts @@ -409,7 +409,12 @@ export class BuildCommand extends Command { } } - const targetRootDir = await findUp(cwd) + const targetRootDir = + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + process.env.CARGO_TARGET_DIR || + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + process.env.CARGO_BUILD_TARGET_DIR || + (await findUp(cwd)) if (!targetRootDir) { throw new TypeError('No target dir found')