How to use the grunt.help function in grunt

To help you get started, we’ve selected a few grunt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cortexjs-legacy / cortex / bin / ctx-init.js View on Github external
var templates;
grunt.help.initTemplates = function() {
  // Initialize task system so that the templates can be listed.
  grunt.task.init([], {help: true});
  // Initialize searchDirs so template assets can be found.
  helpers.initSearchDirs(name);
  // Valid init templates (.js or .coffee files).
  var templatesMap = helpers.getTemplates();
  templates = Object.keys(templatesMap).map(function(name) {
    var description = templatesMap[name].description;
    grunt.help.initCol1(name);
    return [name, description || '(no description)'];
  });
};

grunt.help.templates = function() {
  grunt.log.header('Available templates');
  if (templates.length > 0) {
    grunt.help.table(templates);
  } else {
    grunt.log.writeln().writeln('(No templates found)');
  }
  grunt.log.writeln().writelns(
    'Templates that exist in the ' + helpers.userDir() + ' ' +
    'directory may be run with "grunt-init TEMPLATE". Templates that exist ' +
    'in another location may be run with "grunt-init /path/to/TEMPLATE". A ' +
    'template is a directory that must contain, at the very minimum, a ' +
    'template.js file.'
  );
};

grunt.help.footer = function() {
github cortexjs-legacy / cortex / bin / ctx-init.js View on Github external
];

// Header
grunt.help.header = function() {
  // grunt.log.writeln('grunt-init: Generate project scaffolding from a template. (v' + pkg.version + ')');
};

// Usage info.
grunt.help.usage = function() {
  grunt.log.header('Usage');
  grunt.log.writeln(' ' + node_path.basename(process.argv[1]) + ' [options] [template]');
};

// Template listing.
var templates;
grunt.help.initTemplates = function() {
  // Initialize task system so that the templates can be listed.
  grunt.task.init([], {help: true});
  // Initialize searchDirs so template assets can be found.
  helpers.initSearchDirs(name);
  // Valid init templates (.js or .coffee files).
  var templatesMap = helpers.getTemplates();
  templates = Object.keys(templatesMap).map(function(name) {
    var description = templatesMap[name].description;
    grunt.help.initCol1(name);
    return [name, description || '(no description)'];
  });
};

grunt.help.templates = function() {
  grunt.log.header('Available templates');
  if (templates.length > 0) {
github cortexjs-legacy / cortex / bin / ctx-init.js View on Github external
'initTemplates',
  'initWidths',
  'header',
  'usage',
  'options',
  'templates',
  'footer',
];

// Header
grunt.help.header = function() {
  // grunt.log.writeln('grunt-init: Generate project scaffolding from a template. (v' + pkg.version + ')');
};

// Usage info.
grunt.help.usage = function() {
  grunt.log.header('Usage');
  grunt.log.writeln(' ' + node_path.basename(process.argv[1]) + ' [options] [template]');
};

// Template listing.
var templates;
grunt.help.initTemplates = function() {
  // Initialize task system so that the templates can be listed.
  grunt.task.init([], {help: true});
  // Initialize searchDirs so template assets can be found.
  helpers.initSearchDirs(name);
  // Valid init templates (.js or .coffee files).
  var templatesMap = helpers.getTemplates();
  templates = Object.keys(templatesMap).map(function(name) {
    var description = templatesMap[name].description;
    grunt.help.initCol1(name);
github cortexjs-legacy / cortex / bin / ctx-init.js View on Github external
});

// Help methods to run, in-order.
grunt.help.queue = [
  'initOptions',
  'initTemplates',
  'initWidths',
  'header',
  'usage',
  'options',
  'templates',
  'footer',
];

// Header
grunt.help.header = function() {
  // grunt.log.writeln('grunt-init: Generate project scaffolding from a template. (v' + pkg.version + ')');
};

// Usage info.
grunt.help.usage = function() {
  grunt.log.header('Usage');
  grunt.log.writeln(' ' + node_path.basename(process.argv[1]) + ' [options] [template]');
};

// Template listing.
var templates;
grunt.help.initTemplates = function() {
  // Initialize task system so that the templates can be listed.
  grunt.task.init([], {help: true});
  // Initialize searchDirs so template assets can be found.
  helpers.initSearchDirs(name);
github cortexjs-legacy / cortex / bin / ctx-init.js View on Github external
grunt.log.header('Available templates');
  if (templates.length > 0) {
    grunt.help.table(templates);
  } else {
    grunt.log.writeln().writeln('(No templates found)');
  }
  grunt.log.writeln().writelns(
    'Templates that exist in the ' + helpers.userDir() + ' ' +
    'directory may be run with "grunt-init TEMPLATE". Templates that exist ' +
    'in another location may be run with "grunt-init /path/to/TEMPLATE". A ' +
    'template is a directory that must contain, at the very minimum, a ' +
    'template.js file.'
  );
};

grunt.help.footer = function() {
  grunt.log.writeln().writeln('For more information, see http://gruntjs.com/project-scaffolding');
};

// Display version number if asked.
if (grunt.cli.options.version) {
  // console.log('grunt-init v' + pkg.version);
}

// Start grunt.
grunt.cli();
github cortexjs-legacy / cortex / bin / ctx-init.js View on Github external
grunt.cli.tasks = ['init:' + name];
}

// Remove grunt options that don't really make any sense for grunt-init.
[
  'base',
  'tasks',
  'gruntfile',
  'completion',
  'npm',
].forEach(function(option) {
  delete grunt.cli.optlist[option];
});

// Help methods to run, in-order.
grunt.help.queue = [
  'initOptions',
  'initTemplates',
  'initWidths',
  'header',
  'usage',
  'options',
  'templates',
  'footer',
];

// Header
grunt.help.header = function() {
  // grunt.log.writeln('grunt-init: Generate project scaffolding from a template. (v' + pkg.version + ')');
};

// Usage info.
github cortexjs-legacy / cortex / bin / ctx-init.js View on Github external
grunt.help.templates = function() {
  grunt.log.header('Available templates');
  if (templates.length > 0) {
    grunt.help.table(templates);
  } else {
    grunt.log.writeln().writeln('(No templates found)');
  }
  grunt.log.writeln().writelns(
    'Templates that exist in the ' + helpers.userDir() + ' ' +
    'directory may be run with "grunt-init TEMPLATE". Templates that exist ' +
    'in another location may be run with "grunt-init /path/to/TEMPLATE". A ' +
    'template is a directory that must contain, at the very minimum, a ' +
    'template.js file.'
  );
};