Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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() {
];
// 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) {
'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);
});
// 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);
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();
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.
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.'
);
};