([action, ...args])
| 85 | } |
| 86 | |
| 87 | async execWorkspaces ([action, ...args]) { |
| 88 | await this.setWorkspaces() |
| 89 | // ls pkg or owner add/rm package |
| 90 | if ((action === 'ls' && args.length > 0) || args.length > 1) { |
| 91 | const implicitWorkspaces = this.npm.config.get('workspace', 'default') |
| 92 | if (implicitWorkspaces.length === 0) { |
| 93 | log.warn(`Ignoring specified workspace(s)`) |
| 94 | } |
| 95 | return this.exec([action, ...args]) |
| 96 | } |
| 97 | |
| 98 | for (const [name] of this.workspaces) { |
| 99 | if (action === 'ls' || action === 'list') { |
| 100 | await this.ls(name) |
| 101 | } else if (action === 'add') { |
| 102 | await this.changeOwners(args[0], name, 'add') |
| 103 | } else if (action === 'rm' || action === 'remove') { |
| 104 | await this.changeOwners(args[0], name, 'rm') |
| 105 | } else { |
| 106 | throw this.usageError() |
| 107 | } |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | async ls (pkg) { |
| 112 | pkg = await this.getPkg(this.npm.prefix, pkg) |
nothing calls this directly
no test coverage detected