template.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * grunt-init-amber
  3. * https://amber-lang.net/
  4. *
  5. * Copyright (c) 2013 Manfred Kroehnert, contributors
  6. * Licensed under the MIT license.
  7. */
  8. 'use strict';
  9. // Basic template description.
  10. exports.description = 'Create an Amber Smalltalk based application.';
  11. // Template-specific notes to be displayed before question prompts.
  12. exports.notes = ' _Project title_ should be a human-readable title.';
  13. // Template-specific notes to be displayed after question prompts.
  14. exports.after = 'You should now install project dependencies with _npm install_.' +
  15. ' After that, you may execute project tasks with _grunt_.' +
  16. ' Fmore information about installing and configuring Grunt, please see ' +
  17. 'the Getting Started guide:' +
  18. '\n\n' +
  19. 'http://gruntjs.com/getting-started';
  20. // Any existing file or directory matching this wildcard will cause a warning.
  21. exports.warnOn = '*';
  22. // The actual init template.
  23. exports.template = function(grunt, init, done) {
  24. init.process({type: 'amber'}, [
  25. // Prompt for these values.
  26. init.prompt('name', 'AmberApp'),
  27. init.prompt('title'),
  28. init.prompt('description', 'Amber Application.'),
  29. init.prompt('version'),
  30. init.prompt('repository'),
  31. init.prompt('homepage'),
  32. init.prompt('bugs'),
  33. init.prompt('licenses', 'MIT'),
  34. init.prompt('author_name'),
  35. init.prompt('author_email'),
  36. init.prompt('author_url')
  37. ], function(err, props) {
  38. // A few additional properties.
  39. props.amberjson = props.name + '.amber.json';
  40. props.dependencies = {'amber': '~0.10.0'};
  41. props.keywords = ['Amber'];
  42. //props.devDependencies = {'amber': '~0.10.0'};
  43. props.node_version = '>= 0.8.0';
  44. // Files to copy (and process).
  45. var files = init.filesToCopy(props);
  46. // Add properly-named license files.
  47. init.addLicenseFiles(files, props.licenses);
  48. // Actually copy (and process) files.
  49. init.copyAndProcess(files, props, {noProcess: 'libs/**'});
  50. // Generate package.json file, used by npm and grunt.
  51. init.writePackageJSON('package.json', props);
  52. // All done!
  53. done();
  54. });
  55. };