From d2afb9dd0eef1bc12318705d7f0f6d24673930d2 Mon Sep 17 00:00:00 2001 From: Ugo Bechameil Date: Wed, 20 Sep 2023 14:54:02 +0200 Subject: [PATCH] Adapt fixing base dir for modules to rebuild --- rebuild.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rebuild.js b/rebuild.js index 0f14564..53791b8 100644 --- a/rebuild.js +++ b/rebuild.js @@ -16,8 +16,11 @@ const modulesToBuild = modules .filter(mod => mod.targetPlatform === platform() && mod.targetArch === arch()) .map(module => { // Base dir might have changed between runs - const moduleName = module.name; - module.module.baseDir = `${ROOT_DIR}/${moduleName}`; + const oldBaseDir = module.baseDir; + const reg = new RegExp('.+/native-deps-buildkit/node_modules') + const fixedBaseDir = oldBaseDir.replace(reg, `${ROOT_DIR}/node_modules`) + log('--> using new baseDir: %o', fixedBaseDir); + module.module.baseDir = fixedBaseDir; return module; });