From 1b73d0c283ca682ea630ac295e278fec4a356d0f Mon Sep 17 00:00:00 2001 From: Michael Gangolf Date: Tue, 9 Jul 2024 20:48:40 +0200 Subject: [PATCH] fix(win): permission issues when building a module --- cli/commands/build.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cli/commands/build.js b/cli/commands/build.js index 40c3c6e91cb..3e378d65449 100644 --- a/cli/commands/build.js +++ b/cli/commands/build.js @@ -420,8 +420,13 @@ function patchLogger(logger, cli) { fs.ensureDirSync(buildDir, 0o766); - // create our write stream - logger.log.filestream = fs.createWriteStream(path.join(buildDir, 'build_' + platform + '.log'), { flags: 'w', encoding: 'utf8', mode: 0o666 }); + if (process.platform === 'win32' && cli.argv.type === 'module') { + // disable file logging for windows when building a module + logger.fileWriteEnabled = false; + } else { + // create our write stream + logger.log.filestream = fs.createWriteStream(path.join(buildDir, 'build_' + platform + '.log'), { flags: 'w', encoding: 'utf8', mode: 0o666 }); + } function styleHeading(s) { return ('' + s).bold;