mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-30 10:38:13 -05:00
fix(patch-remove): check if the parameters are valid (#9809)
This commit is contained in:
5
.changeset/wicked-deer-drive.md
Normal file
5
.changeset/wicked-deer-drive.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-patching": patch
|
||||
---
|
||||
|
||||
When executing the `pnpm patch-remove` command, verify whether the passed parameter is a valid patch package name.
|
||||
@@ -54,6 +54,12 @@ export async function handler (opts: PatchRemoveCommandOptions, params: string[]
|
||||
throw new PnpmError('NO_PATCHES_TO_REMOVE', 'There are no patches that need to be removed')
|
||||
}
|
||||
|
||||
for (const patch of patchesToRemove) {
|
||||
if (!Object.hasOwn(patchedDependencies, patch)) {
|
||||
throw new PnpmError('PATCH_NOT_FOUND', `Patch "${patch}" not found in patched dependencies`)
|
||||
}
|
||||
}
|
||||
|
||||
const patchesDirs = new Set<string>()
|
||||
await Promise.all(patchesToRemove.map(async (patch) => {
|
||||
if (Object.hasOwn(patchedDependencies, patch)) {
|
||||
|
||||
Reference in New Issue
Block a user