diff --git a/.yarn/versions/5c3d25bd.yml b/.yarn/versions/5c3d25bd.yml new file mode 100644 index 00000000000..b9ef967a4a3 --- /dev/null +++ b/.yarn/versions/5c3d25bd.yml @@ -0,0 +1,23 @@ +releases: + "@yarnpkg/cli": patch + "@yarnpkg/plugin-essentials": patch + +declined: + - "@yarnpkg/plugin-compat" + - "@yarnpkg/plugin-constraints" + - "@yarnpkg/plugin-dlx" + - "@yarnpkg/plugin-init" + - "@yarnpkg/plugin-interactive-tools" + - "@yarnpkg/plugin-nm" + - "@yarnpkg/plugin-npm-cli" + - "@yarnpkg/plugin-pack" + - "@yarnpkg/plugin-patch" + - "@yarnpkg/plugin-pnp" + - "@yarnpkg/plugin-pnpm" + - "@yarnpkg/plugin-stage" + - "@yarnpkg/plugin-typescript" + - "@yarnpkg/plugin-version" + - "@yarnpkg/plugin-workspace-tools" + - "@yarnpkg/builder" + - "@yarnpkg/core" + - "@yarnpkg/doctor" diff --git a/packages/plugin-essentials/sources/commands/dedupe.ts b/packages/plugin-essentials/sources/commands/dedupe.ts index e7221d425dd..8ef8f1f7552 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, + }); } }