(git, version, opts)
| 289 | }; |
| 290 | |
| 291 | function 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 | |
| 329 | Module.runInstallScripts = function runInstallScripts (modulePath, cb) { |
| 330 | logger.log('running install scripts...'); |
no outgoing calls
no test coverage detected
searching dependent graphs…