(args, arb)
| 196 | } |
| 197 | |
| 198 | async runPositional (args, arb) { |
| 199 | const { matched, unmatched } = this.findNodesForArgs(args, arb) |
| 200 | if (unmatched.length > 0) { |
| 201 | throw Object.assign( |
| 202 | new Error(`No installed packages match: ${unmatched.join(', ')}`), |
| 203 | { code: 'ENOMATCH' } |
| 204 | ) |
| 205 | } |
| 206 | const groups = this.groupByPackage(matched) |
| 207 | /* istanbul ignore if: matched is non-empty here; groups only empties when a |
| 208 | matched node has no trusted key, which groupByPackage already warns on */ |
| 209 | if (Object.keys(groups).length === 0) { |
| 210 | throw Object.assign( |
| 211 | new Error(`No installed packages match: ${args.join(', ')}`), |
| 212 | { code: 'ENOMATCH' } |
| 213 | ) |
| 214 | } |
| 215 | await this.writePolicyChanges(groups) |
| 216 | } |
| 217 | |
| 218 | findNodesForArgs (args, arb) { |
| 219 | // Match positional args against each node's trusted name. Registry deps |
no test coverage detected