mirror of
https://github.com/pnpm/pnpm.git
synced 2026-07-25 15:07:06 -04:00
fix: exit approve-builds command when getAutomaticallyIgnoredBuilds return empty list (#9024)
* fix: exit `approve-builds` command when `getAutomaticallyIgnoredBuilds` return empty list * feat: print an info message when there are no packages to approve --------- Co-authored-by: Zoltan Kochan <z@kochan.io>
This commit is contained in:
5
.changeset/serious-schools-perform.md
Normal file
5
.changeset/serious-schools-perform.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/exec.build-commands": patch
|
||||
---
|
||||
|
||||
`approve-builds` command gets the auto-ignore build list and exits early when it is an empty array [#9024](https://github.com/pnpm/pnpm/pull/9024).
|
||||
@@ -1,4 +1,5 @@
|
||||
import { type Config } from '@pnpm/config'
|
||||
import { globalInfo } from '@pnpm/logger'
|
||||
import { readProjectManifest } from '@pnpm/read-project-manifest'
|
||||
import renderHelp from 'render-help'
|
||||
import { prompt } from 'enquirer'
|
||||
@@ -28,7 +29,10 @@ export function rcOptionsTypes (): Record<string, unknown> {
|
||||
export async function handler (opts: ApproveBuildsCommandOpts & RebuildCommandOpts): Promise<void> {
|
||||
if (opts.rootProjectManifest == null) return
|
||||
const automaticallyIgnoredBuilds = await getAutomaticallyIgnoredBuilds(opts)
|
||||
if (automaticallyIgnoredBuilds == null) return
|
||||
if (!automaticallyIgnoredBuilds?.length) {
|
||||
globalInfo('There are no packages awaiting approval')
|
||||
return
|
||||
}
|
||||
const { result } = await prompt({
|
||||
choices: sortStrings([...automaticallyIgnoredBuilds]),
|
||||
indicator (state: any, choice: any) { // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||
|
||||
Reference in New Issue
Block a user