fix: running approve-builds from a subdirectory of a workspace (#9048)

This commit is contained in:
Zoltan Kochan
2025-02-05 23:45:26 +01:00
committed by GitHub
parent bdaf892000
commit afbb65495e
3 changed files with 8 additions and 2 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/exec.build-commands": patch
"pnpm": patch
---
`pnpm approve-builds` should work, when executed from a subdirectory of a workspace [#9042](https://github.com/pnpm/pnpm/issues/9042).

View File

@@ -3,7 +3,7 @@ import { readModulesManifest } from '@pnpm/modules-yaml'
import { type IgnoredBuildsCommandOpts } from './ignoredBuilds'
export async function getAutomaticallyIgnoredBuilds (opts: IgnoredBuildsCommandOpts): Promise<null | string[]> {
const modulesManifest = await readModulesManifest(opts.modulesDir ?? path.join(opts.dir, 'node_modules'))
const modulesManifest = await readModulesManifest(opts.modulesDir ?? path.join(opts.lockfileDir ?? opts.dir, 'node_modules'))
if (modulesManifest == null) {
return null
}

View File

@@ -2,7 +2,7 @@ import { type Config } from '@pnpm/config'
import renderHelp from 'render-help'
import { getAutomaticallyIgnoredBuilds } from './getAutomaticallyIgnoredBuilds'
export type IgnoredBuildsCommandOpts = Pick<Config, 'modulesDir' | 'dir' | 'rootProjectManifest'>
export type IgnoredBuildsCommandOpts = Pick<Config, 'modulesDir' | 'dir' | 'rootProjectManifest' | 'lockfileDir'>
export const commandNames = ['ignored-builds']