install.js 643 B

12345678910111213141516171819202122232425262728293031
  1. 'use strict';
  2. var inquiries = require( './inquiries' );
  3. var common = require( './common' );
  4. /**
  5. * Executes plugin install grunt task.
  6. * @param grunt
  7. * @param done
  8. */
  9. module.exports = function( grunt, done ) {
  10. var data = {
  11. grunt: grunt,
  12. cwd: process.cwd(),
  13. pluginName: '',
  14. repositoryLocation: '',
  15. gitHubUrl: ''
  16. };
  17. inquiries.getPluginName( data )
  18. .then( inquiries.getRepositoryLocation )
  19. .then( inquiries.getPluginGitHubUrl )
  20. .then( common.cloneRepository )
  21. .then( common.linkPlugin )
  22. .then( common.updatePackageJson )
  23. .then( function() {
  24. done();
  25. } )
  26. .catch( function( error ) {
  27. done( error );
  28. } );
  29. };