Skip to content

Commit 626d059

Browse files
committed
fix: workspaces foreach should take --all by default
1 parent c3b319a commit 626d059

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.yarn/versions/ecd497b5.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
releases:
2+
"@yarnpkg/cli": patch
3+
"@yarnpkg/plugin-workspace-tools": patch
4+
5+
declined:
6+
- "@yarnpkg/plugin-compat"
7+
- "@yarnpkg/plugin-constraints"
8+
- "@yarnpkg/plugin-dlx"
9+
- "@yarnpkg/plugin-essentials"
10+
- "@yarnpkg/plugin-init"
11+
- "@yarnpkg/plugin-interactive-tools"
12+
- "@yarnpkg/plugin-nm"
13+
- "@yarnpkg/plugin-npm-cli"
14+
- "@yarnpkg/plugin-pack"
15+
- "@yarnpkg/plugin-patch"
16+
- "@yarnpkg/plugin-pnp"
17+
- "@yarnpkg/plugin-pnpm"
18+
- "@yarnpkg/plugin-stage"
19+
- "@yarnpkg/plugin-typescript"
20+
- "@yarnpkg/plugin-version"
21+
- "@yarnpkg/builder"
22+
- "@yarnpkg/core"
23+
- "@yarnpkg/doctor"

packages/plugin-workspace-tools/sources/commands/foreach.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ export default class WorkspacesForeachCommand extends BaseCommand {
136136
const configuration = await Configuration.find(this.context.cwd, this.context.plugins);
137137
const {project, workspace: cwdWorkspace} = await Project.find(configuration, this.context.cwd);
138138

139+
if ([`all`, `recursive`, `since`, `worktree`].every(opt => this[opt] === undefined))
140+
this.all = true;
141+
139142
if (!this.all && !cwdWorkspace)
140143
throw new WorkspaceRequiredError(project.cwd, this.context.cwd);
141144

0 commit comments

Comments
 (0)