base-generators
Advanced tools
Comparing version 0.1.9 to 0.1.10
40
index.js
@@ -535,2 +535,24 @@ /*! | ||
/** | ||
* Getter/setter for defining the `configname` name to use for lookups. | ||
* By default `configname` is set to `generator.js`. | ||
* | ||
* @name .configname | ||
* @api public | ||
*/ | ||
Object.defineProperty(app, 'configname', { | ||
configurable: true, | ||
set: function(configname) { | ||
this.options.configname = configname; | ||
this.options.configfile = configname + '.js'; | ||
}, | ||
get: function() { | ||
if (this.options.configname) { | ||
return this.options.configname; | ||
} | ||
return (this.options.configname = utils.basename(this.configfile)); | ||
} | ||
}); | ||
/** | ||
* Getter/setter for defining the `configfile` name to use for lookups. | ||
@@ -554,2 +576,20 @@ * By default `configfile` is set to `generator.js`. | ||
/** | ||
* Getter/setter for defining the `configpath` name to use for lookups. | ||
* By default `configpath` is set to `generator.js`. | ||
* | ||
* @name .configpath | ||
* @api public | ||
*/ | ||
Object.defineProperty(app, 'configpath', { | ||
configurable: true, | ||
set: function(configpath) { | ||
this.options.configpath = path.resolve(configpath); | ||
}, | ||
get: function() { | ||
return this.options.configpath || path.resolve(this.cwd, this.configfile); | ||
} | ||
}); | ||
/** | ||
* Getter/setter for defining the `modulename` name to use for lookups. | ||
@@ -556,0 +596,0 @@ * By default `modulename` is set to `generate`. |
'use strict'; | ||
/** | ||
* Module dependencies | ||
*/ | ||
var path = require('path'); | ||
var debug = require('debug')('base:generators:utils'); | ||
@@ -59,2 +56,10 @@ var utils = require('lazy-cache')(require); | ||
/** | ||
* Get the basename of a filepath, excluding extension. | ||
*/ | ||
utils.basename = function(fp) { | ||
return path.basename(fp, path.extname(fp)); | ||
}; | ||
/** | ||
* Expose `utils` | ||
@@ -61,0 +66,0 @@ */ |
{ | ||
"name": "base-generators", | ||
"description": "Adds project-generator support to your `base` application.", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"homepage": "https://github.com/jonschlinkert/base-generators", | ||
@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", |
50329
1006