generator-yomonger
Version:
A yeoman generator for MODX Manager custom themes.
31 lines (25 loc) • 1.17 kB
JavaScript
// Example of a simple generator.
//
// A raw function that is executed when this generator is resolved.
//
// It takes a list of arguments (usually CLI args) and a Hash of options
// (CLI options), the context of the function is a `new Generator.Base`
// object, which means that you can use the API as if you were extending
// `Base`.
//
// It works with simple generator, if you need to do a bit more complex
// stuff, extends from Generator.Base and defines your generator steps
// in several methods.
var util = require('util');
var generators = require('../../../main');
module.exports = function(args, options) {
generators.Base.apply(this, arguments);
console.log('Executing generator with', args, options);
};
util.inherits(module.exports, generators.Base);
module.exports.name = 'You can name your generator';
module.exports.description = 'Ana add a custom description by adding a `description` property to your function.';
module.exports.usage = 'Usage can be used to customize the help output';
// namespace is resolved depending on the location of this generator,
// unless you specifically define it.
module.exports.namespace = 'mocha:generator';