| 52 | } |
| 53 | |
| 54 | async execWorkspaces (args) { |
| 55 | const useWorkspaces = args.length === 0 || args.includes('.') |
| 56 | if (!useWorkspaces) { |
| 57 | log.warn('Ignoring workspaces for specified package(s)') |
| 58 | return this.exec(args) |
| 59 | } |
| 60 | await this.setWorkspaces() |
| 61 | |
| 62 | for (const [name, workspace] of this.workspaces.entries()) { |
| 63 | try { |
| 64 | await this.#publish([workspace], { workspace: name }) |
| 65 | } catch (err) { |
| 66 | if (err.code !== 'EPRIVATE') { |
| 67 | throw err |
| 68 | } |
| 69 | log.warn(this.#command, `Skipping workspace ${this.npm.chalk.cyan(name)}, marked as ${this.npm.chalk.bold('private')}`) |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | get #command () { |
| 75 | return this.isStage ? 'stage' : 'publish' |