MCPcopy
hub / github.com/vercel/hyper / saveBuildArtifacts

Method saveBuildArtifacts

bin/yarn-standalone.js:102746–102785  ·  view source on GitHub ↗
(loc, pkg, beforeFiles, spinner)

Source from the content-addressed store, hash-verified

102744 }
102745
102746 saveBuildArtifacts(loc, pkg, beforeFiles, spinner) {
102747 var _this2 = this;
102748
102749 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
102750 const afterFiles = yield _this2.walk(loc);
102751
102752 // work out what files have been created/modified
102753 const buildArtifacts = [];
102754 for (var _iterator3 = afterFiles, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
102755 var _ref4;
102756
102757 if (_isArray3) {
102758 if (_i3 >= _iterator3.length) break;
102759 _ref4 = _iterator3[_i3++];
102760 } else {
102761 _i3 = _iterator3.next();
102762 if (_i3.done) break;
102763 _ref4 = _i3.value;
102764 }
102765
102766 const _ref3 = _ref4;
102767 const file = _ref3[0];
102768 const mtime = _ref3[1];
102769
102770 if (!beforeFiles.has(file) || beforeFiles.get(file) !== mtime) {
102771 buildArtifacts.push(file);
102772 }
102773 }
102774
102775 if (!buildArtifacts.length) {
102776 // nothing else to do here since we have no build artifacts
102777 return;
102778 }
102779
102780 // set build artifacts
102781 const ref = pkg._reference;
102782 invariant(ref, 'expected reference');
102783 _this2.artifacts[`${pkg.name}@${pkg.version}`] = buildArtifacts;
102784 })();
102785 }
102786
102787 install(cmds, pkg, spinner) {
102788 var _this3 = this;

Callers 1

initMethod · 0.80

Calls 7

_load_asyncToGeneratorFunction · 0.85
invariantFunction · 0.85
walkMethod · 0.80
hasMethod · 0.80
getMethod · 0.80
nextMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected