From e69f0230c24cb74d55287fe191d05edf53d7830a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Kochen?= Date: Wed, 2 Mar 2022 13:40:24 +0100 Subject: [PATCH] fix(cli): temporary dts path may not be writable --- 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 da665e23..9d6c8517 100644 --- a/cli/src/build.ts +++ b/cli/src/build.ts @@ -1,5 +1,6 @@ import { execSync } from 'child_process' import { existsSync, mkdirSync } from 'fs' +import { tmpdir } from 'os' import { join, parse, sep } from 'path' import { Instance } from 'chalk' @@ -200,7 +201,7 @@ export class BuildCommand extends Command { .filter((flag) => Boolean(flag)) .join(' ') const cargoCommand = `cargo build ${externalFlags}` - const intermediateTypeFile = join(__dirname, `type_def.${Date.now()}.tmp`) + const intermediateTypeFile = join(tmpdir(), `type_def.${Date.now()}.tmp`) debug(`Run ${chalk.green(cargoCommand)}`) const additionalEnv = {} if (