diff --git a/.yarn/versions/5c3d25bd.yml b/.yarn/versions/5c3d25bd.yml new file mode 100644 index 000000000000..03c82c608381 --- /dev/null +++ b/.yarn/versions/5c3d25bd.yml @@ -0,0 +1,34 @@ +releases: + "@yarnpkg/builder": patch + "@yarnpkg/cli": patch + "@yarnpkg/core": patch + "@yarnpkg/doctor": patch + "@yarnpkg/extensions": patch + "@yarnpkg/nm": patch + "@yarnpkg/plugin-catalog": patch + "@yarnpkg/plugin-compat": patch + "@yarnpkg/plugin-constraints": patch + "@yarnpkg/plugin-dlx": patch + "@yarnpkg/plugin-essentials": patch + "@yarnpkg/plugin-exec": patch + "@yarnpkg/plugin-file": patch + "@yarnpkg/plugin-git": patch + "@yarnpkg/plugin-github": patch + "@yarnpkg/plugin-http": patch + "@yarnpkg/plugin-init": patch + "@yarnpkg/plugin-interactive-tools": patch + "@yarnpkg/plugin-jsr": patch + "@yarnpkg/plugin-link": patch + "@yarnpkg/plugin-nm": patch + "@yarnpkg/plugin-npm": patch + "@yarnpkg/plugin-npm-cli": patch + "@yarnpkg/plugin-pack": patch + "@yarnpkg/plugin-patch": patch + "@yarnpkg/plugin-pnp": patch + "@yarnpkg/plugin-pnpm": patch + "@yarnpkg/plugin-stage": patch + "@yarnpkg/plugin-typescript": patch + "@yarnpkg/plugin-version": patch + "@yarnpkg/plugin-workspace-tools": patch + "@yarnpkg/pnpify": patch + "@yarnpkg/sdks": patch diff --git a/packages/plugin-essentials/sources/commands/dedupe.ts b/packages/plugin-essentials/sources/commands/dedupe.ts index e7221d425dd8..8ef8f1f7552c 100644 --- a/packages/plugin-essentials/sources/commands/dedupe.ts +++ b/packages/plugin-essentials/sources/commands/dedupe.ts @@ -116,16 +116,18 @@ export default class DedupeCommand extends BaseCommand { if (dedupeReport.hasErrors()) return dedupeReport.exitCode(); - if (this.check) { + if (this.check) return dedupedPackageCount ? 1 : 0; - } else { - return await project.installWithNewReport({ - json: this.json, - stdout: this.context.stdout, - }, { - cache, - mode: this.mode, - }); - } + + if (dedupedPackageCount === 0) + return 0; + + return await project.installWithNewReport({ + json: this.json, + stdout: this.context.stdout, + }, { + cache, + mode: this.mode, + }); } }