MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / _upgrade

Method _upgrade

tests/helpers/package-cache.js:535–553  ·  view source on GitHub ↗

* The `_upgrade` method guarantees that the contents of the manifest are * allowed to drift in a SemVer compatible manner. It ensures that CI is * always running against the latest versions of all dependencies. * * @private * @method _upgrade * @param {String} label The label for t

(label, type)

Source from the content-addressed store, hash-verified

533 * @param {String} type The type of package cache.
534 */
535 _upgrade(label, type) {
536 // Lock out upgrade calls after the first time upgrading the cache.
537 if (upgraded[label]) {
538 return;
539 }
540
541 if (!this._canUpgrade(label, type)) {
542 // Only way to get repeatable behavior in npm: start over.
543 // We turn an `_upgrade` task into an `_install` task.
544 fs.removeSync(path.join(this.dirs[label], translate(type, 'path')));
545 return this._install(label, type);
546 }
547
548 this._removeLinks(label, type);
549 commands[type].invoke(translate(type, 'upgrade'), { cwd: this.dirs[label] });
550 this._restoreLinks(label, type);
551
552 upgraded[label] = true;
553 }
554
555 _canUpgrade(label, type) {
556 return type === 'yarn' && fs.existsSync(path.join(this.dirs[label], 'yarn.lock'));

Callers 2

createMethod · 0.95

Calls 6

_canUpgradeMethod · 0.95
_installMethod · 0.95
_removeLinksMethod · 0.95
_restoreLinksMethod · 0.95
translateFunction · 0.85
invokeMethod · 0.80

Tested by

no test coverage detected