()
| 493 | } |
| 494 | |
| 495 | install() { |
| 496 | if (this.shouldExit()) return false; |
| 497 | debug('install npm dependencies'); |
| 498 | const pkgJson = this.packageJson || {}; |
| 499 | const deps = pkgJson.get('dependencies') || {}; |
| 500 | const pkgs = []; |
| 501 | const connectorVersionRange = deps['loopback-connector-openapi']; |
| 502 | if (!connectorVersionRange) { |
| 503 | // No dependency found for loopback-connector-openapi |
| 504 | pkgs.push('loopback-connector-openapi'); |
| 505 | } else { |
| 506 | // `loopback-connector-openapi` exists - make sure its version range |
| 507 | // is >= 6.0.0 |
| 508 | try { |
| 509 | const minVersion = semver.minVersion(connectorVersionRange); |
| 510 | if (semver.lt(minVersion, '6.0.0')) { |
| 511 | pkgs.push('loopback-connector-openapi@^6.0.0'); |
| 512 | } |
| 513 | } catch (err) { |
| 514 | // The version can be a tarball |
| 515 | this.log(err); |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | if (pkgs.length === 0) return; |
| 520 | |
| 521 | this.pkgManagerInstall(pkgs, { |
| 522 | npm: { |
| 523 | save: true, |
| 524 | }, |
| 525 | }); |
| 526 | } |
| 527 | |
| 528 | async end() { |
| 529 | await super.end(); |
nothing calls this directly
no test coverage detected