MCPcopy Create free account
hub / github.com/play-co/devkit / checkoutVersion

Function checkoutVersion

src/modules/Module.js:291–327  ·  view source on GitHub ↗
(git, version, opts)

Source from the content-addressed store, hash-verified

289};
290
291function checkoutVersion(git, version, opts) {
292 return git
293 .listChanges()
294 .then(function (changes) {
295 var untracked = changes.filter(function (change) {
296 return change.code === '??';
297 });
298
299 if (untracked.length) {
300 logger.warn('Your module has files we don\'t recognize in it. This',
301 'is normally ok, but in some cases it can prevent devkit from',
302 'updating your module. If an error occurs, you should consider',
303 'removing these files and then running this command again:\n'
304 + untracked
305 .map(function (change) {
306 return change.filename;
307 })
308 .join('\n\t'),
309 '\n(' + git.path + ')');
310 }
311
312 // ignore untracked files
313 var modified = changes.filter(function (change) {
314 return change.code !== '??';
315 });
316
317 if (modified.length && !opts.unsafe) {
318 throw new ModifiedTreeError(git.path, changes);
319 }
320
321 return git
322 .checkoutRef(version)
323 .catch(function (e) {
324 throw new CheckoutError(path.basename(git.path), version, e.stderr);
325 });
326 });
327}
328
329Module.runInstallScripts = function runInstallScripts (modulePath, cb) {
330 logger.log('running install scripts...');

Callers 1

Module.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…