From 9be7ae2bf90aa1de32c0787e80661178642f4861 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Sun, 31 Jul 2022 16:41:32 +0200 Subject: [PATCH] feat(cli): use `CARGO_TARGET_DIR` if set (#1251) * feat: use `CARGO_TARGET_DIR` if set * use `||` instead of `??` * use `CARGO_BUILD_TARGET_DIR` also if set * disable eslint prefer-nullish-coalescing --- cli/src/build.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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')