From 65a65cf0211813006eadb7ffc611ee06d88c28a0 Mon Sep 17 00:00:00 2001 From: Julien Ganichot Date: Wed, 15 Nov 2023 12:24:53 +0100 Subject: [PATCH] test: tryfix --- bootstrap.mjs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/bootstrap.mjs b/bootstrap.mjs index 233e69b1d..858599325 100644 --- a/bootstrap.mjs +++ b/bootstrap.mjs @@ -1,15 +1,18 @@ +import path from 'path'; +import { fileURLToPath } from 'url'; import { execSync } from 'child_process'; -try { - const __dirname = new URL('.', import.meta.url).pathname; +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); - execSync( - 'npm install semantic-release --omit=dev --no-audit --no-progress --prefer-offline', - { - stdio: 'inherit', - cwd: __dirname, +execSync( + 'npm install semantic-release --omit=dev --no-audit --no-progress --prefer-offline', + { + stdio: 'inherit', + cwd: __dirname, + env: { + ...process.env, + PWD: __dirname, }, - ); -} catch (err) { - console.log(err); -} + }, +);