(args)
| 70 | } |
| 71 | |
| 72 | async execWorkspaces (args) { |
| 73 | const { pkg, local, rest } = parseArgs(args) |
| 74 | |
| 75 | if (!local) { |
| 76 | log.warn('Ignoring workspaces for specified package(s)') |
| 77 | return this.exec([pkg, ...rest]) |
| 78 | } |
| 79 | |
| 80 | const json = this.npm.config.get('json') |
| 81 | await this.setWorkspaces() |
| 82 | |
| 83 | for (const name of this.workspaceNames) { |
| 84 | try { |
| 85 | await this.#viewPackage(`${name}${pkg.slice(1)}`, rest, { workspace: true }) |
| 86 | } catch (e) { |
| 87 | const err = getError(e, { npm: this.npm, command: this }) |
| 88 | if (err.code !== 'E404') { |
| 89 | throw e |
| 90 | } |
| 91 | if (json) { |
| 92 | output.buffer({ [META]: true, jsonError: { [name]: jsonError(err, this.npm) } }) |
| 93 | } else { |
| 94 | outputError(err) |
| 95 | } |
| 96 | process.exitCode = err.exitCode |
| 97 | } |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | async #viewPackage (name, args, { workspace } = {}) { |
| 102 | const wholePackument = !args.length |
nothing calls this directly
no test coverage detected