Skip to content

Commit 832b83b

Browse files
committed
feat(init command): override ember-cli's init command with better defaults
Closes #4
1 parent c1c6643 commit 832b83b

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

addon/ng2/commands/init.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use strict';
2+
3+
var InitCommand = require('ember-cli/lib/commands/init');
4+
5+
module.exports = InitCommand .extend({
6+
availableOptions: [
7+
{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
8+
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
9+
{ name: 'blueprint', type: String, aliases: ['b'] },
10+
{ name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] },
11+
{ name: 'skip-bower', type: Boolean, default: true, aliases: ['sb'] },
12+
{ name: 'name', type: String, default: '', aliases: ['n'] }
13+
],
14+
15+
_defaultBlueprint: function() {
16+
if (this.project.isEmberCLIAddon()) {
17+
return 'addon';
18+
} else {
19+
return 'ng2';
20+
}
21+
},
22+
});
23+
24+
module.exports.overrideCore = true;

addon/ng2/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ module.exports = {
55
name: 'ng2',
66
includedCommands: function() {
77
return {
8-
'new': require('./commands/new')
8+
'new': require('./commands/new'),
9+
'init': require('./commands/init')
910
};
1011
}
1112
};

0 commit comments

Comments
 (0)