From b89f2dc256e611efe5627adfdae94e805cb392e3 Mon Sep 17 00:00:00 2001 From: Szymon Dziedzic Date: Mon, 22 Jul 2024 12:15:33 +0200 Subject: [PATCH] [build-tools] run `resolvePackageManager` function in correct directory for custom builds --- packages/build-tools/src/steps/functions/installNodeModules.ts | 2 +- packages/build-tools/src/steps/functions/prebuild.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/build-tools/src/steps/functions/installNodeModules.ts b/packages/build-tools/src/steps/functions/installNodeModules.ts index e07555c2..cb72548b 100644 --- a/packages/build-tools/src/steps/functions/installNodeModules.ts +++ b/packages/build-tools/src/steps/functions/installNodeModules.ts @@ -25,7 +25,7 @@ export async function installNodeModules( env: BuildStepEnv ): Promise { const { logger } = stepCtx; - const packageManager = resolvePackageManager(stepCtx.global.projectTargetDirectory); + const packageManager = resolvePackageManager(stepCtx.workingDirectory); const packagerRunDir = findPackagerRootDir(stepCtx.workingDirectory); let args = ['install']; if (packageManager === PackageManager.PNPM) { diff --git a/packages/build-tools/src/steps/functions/prebuild.ts b/packages/build-tools/src/steps/functions/prebuild.ts index ac3602c2..2a52c5c5 100644 --- a/packages/build-tools/src/steps/functions/prebuild.ts +++ b/packages/build-tools/src/steps/functions/prebuild.ts @@ -34,7 +34,7 @@ export function createPrebuildBuildFunction(): BuildFunction { fn: async (stepCtx, { inputs, env }) => { const { logger } = stepCtx; const appleTeamId = inputs.apple_team_id.value as string | undefined; - const packageManager = resolvePackageManager(stepCtx.global.projectTargetDirectory); + const packageManager = resolvePackageManager(stepCtx.workingDirectory); assert(stepCtx.global.staticContext.job, 'Job is not defined'); const job = stepCtx.global.staticContext.job;