Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Prevent addon-import blueprint from generating if entity name is undefined #3846

Merged
merged 2 commits into from
May 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/tasks/generate-from-blueprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@ module.exports = Task.extend({
run: function(options) {
var self = this;
var name = options.args[0];
var noAddonBlueprint = ['mixin','route'];
var noAddonBlueprint = ['mixin', 'route'];

var mainBlueprint = this.lookupBlueprint(name, options.ignoreMissingMain);
var testBlueprint = this.lookupBlueprint(name + '-test', true);
// lookup custom addon blueprint
var addonBlueprint = this.lookupBlueprint(name + '-addon', true);
// otherwise, use default addon-import
if (noAddonBlueprint.indexOf(name) < 0 && !addonBlueprint && mainBlueprint.supportsAddon()) {

if (noAddonBlueprint.indexOf(name) < 0 && !addonBlueprint && (mainBlueprint && mainBlueprint.supportsAddon()) && options.args[1]) {
addonBlueprint = this.lookupBlueprint('addon-import', true);
}

if (options.ignoreMissingMain && !mainBlueprint) {
return Promise.resolve();
}
Expand Down
8 changes: 7 additions & 1 deletion tests/acceptance/install-test-slow.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var remove = Promise.denodeify(require('fs-extra').remove);
var root = process.cwd();
var tmp = require('tmp-sync');
var tmproot = path.join(root, 'tmp');
var expect = require('chai').expect;

describe('Acceptance: ember install', function() {
this.timeout(30000);
Expand Down Expand Up @@ -52,7 +53,7 @@ describe('Acceptance: ember install', function() {
}

it('installs via npm and runs generator', function() {
return installAddon(['ember-cli-fastclick']).then(function() {
return installAddon(['ember-cli-fastclick']).then(function(result) {
assertFile('package.json', {
contains: [
/"ember-cli-fastclick": ".*"/
Expand All @@ -64,6 +65,11 @@ describe('Acceptance: ember install', function() {
/"fastclick": ".*"/
]
});

expect(result.ui.output).not.to.include('The `ember generate` command '+
'requires an entity name to be specified. For more details, use `ember help`.');

});
});

});