(args, arb)
| 168 | } |
| 169 | |
| 170 | async runPositional (args, arb) { |
| 171 | const { matched, unmatched } = this.findNodesForArgs(args, arb) |
| 172 | if (unmatched.length > 0) { |
| 173 | throw Object.assign( |
| 174 | new Error(`No installed packages match: ${unmatched.join(', ')}`), |
| 175 | { code: 'ENOMATCH' } |
| 176 | ) |
| 177 | } |
| 178 | const groups = this.groupByPackage(matched) |
| 179 | /* istanbul ignore if: matched is non-empty here; groups only empties when a |
| 180 | matched node has no trusted key, which groupByPackage already warns on */ |
| 181 | if (Object.keys(groups).length === 0) { |
| 182 | throw Object.assign( |
| 183 | new Error(`No installed packages match: ${args.join(', ')}`), |
| 184 | { code: 'ENOMATCH' } |
| 185 | ) |
| 186 | } |
| 187 | await this.writePolicyChanges(groups) |
| 188 | } |
| 189 | |
| 190 | findNodesForArgs (args, arb) { |
| 191 | // Match positional args against each node's trusted name. Registry deps |
no test coverage detected