Skip to content

Commit

Permalink
feat(init command): override ember-cli's init command with better def…
Browse files Browse the repository at this point in the history
…aults

Closes #4
  • Loading branch information
rodyhaddad committed Jul 24, 2015
1 parent c1c6643 commit 832b83b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
24 changes: 24 additions & 0 deletions addon/ng2/commands/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use strict';

var InitCommand = require('ember-cli/lib/commands/init');

module.exports = InitCommand .extend({
availableOptions: [
{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'blueprint', type: String, aliases: ['b'] },
{ name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] },
{ name: 'skip-bower', type: Boolean, default: true, aliases: ['sb'] },
{ name: 'name', type: String, default: '', aliases: ['n'] }
],

_defaultBlueprint: function() {
if (this.project.isEmberCLIAddon()) {
return 'addon';
} else {
return 'ng2';
}
},
});

module.exports.overrideCore = true;
3 changes: 2 additions & 1 deletion addon/ng2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module.exports = {
name: 'ng2',
includedCommands: function() {
return {
'new': require('./commands/new')
'new': require('./commands/new'),
'init': require('./commands/init')
};
}
};

0 comments on commit 832b83b

Please sign in to comment.