base-generators
Advanced tools
Comparing version 0.2.8 to 0.2.9
16
index.js
@@ -453,2 +453,4 @@ /*! | ||
var resolved = this.resolveTasks.apply(this, args); | ||
resolved.orig = args; | ||
if (cb.name === 'finishRun' && resolved.tasks.indexOf(name) !== -1) { | ||
@@ -515,8 +517,15 @@ var generator = this.getGenerator(name); | ||
if (!tasks) { | ||
this.emit('error', new Error('no default task defined')); | ||
return next(); | ||
// if no tasks were resolved, but the user specified tasks to run, emit an error | ||
var orig = resolved.orig; | ||
if (orig.length > 1 || orig[0] !== 'default') { | ||
this.emit('error', new Error('no default task defined')); | ||
} | ||
// otherwise we can assume the user is running custom code | ||
next(); | ||
return; | ||
} | ||
if (!generator) { | ||
this.emit('error', new Error(name + ' generator is not registered')); | ||
return next(); | ||
next(); | ||
return; | ||
} | ||
@@ -597,2 +606,3 @@ | ||
async.eachSeries(arr, function(obj, next) { | ||
obj.resolved.orig = tasks; | ||
app.runTasks(obj.name, obj.resolved, next); | ||
@@ -599,0 +609,0 @@ }, cb); |
{ | ||
"name": "base-generators", | ||
"description": "Adds project-generator support to your `base` application.", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"homepage": "https://github.com/node-base/base-generators", | ||
@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", |
@@ -60,3 +60,3 @@ # base-generators [](https://www.npmjs.com/package/base-generators) [](https://npmjs.org/package/base-generators) [](https://travis-ci.org/node-base/base-generators) | ||
Tasks are exactly the same as [gulp](http://gulpjs.com) tasks, and are powered by [bach](https://github.com/gulpjs/bach#readme) and [composer](https://github.com/doowb/composer). | ||
Tasks are exactly the same as [gulp](http://gulpjs.com) tasks, and are powered by [bach](https://github.com/gulpjs/bach) and [composer](https://github.com/doowb/composer). | ||
@@ -444,3 +444,3 @@ **Register a task:** | ||
### [.generateEach](index.js#L571) | ||
### [.generateEach](index.js#L580) | ||
@@ -464,3 +464,3 @@ Iterate over an array of generators and tasks, calling [generate](#generate) on each. | ||
### [.toAlias](index.js#L622) | ||
### [.toAlias](index.js#L632) | ||
@@ -655,2 +655,2 @@ Create a generator alias from the given `name`. By default the alias is the string after the last dash. Or the whole string if no dash exists. | ||
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on April 24, 2016._ | ||
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 03, 2016._ |
50940
982