File tree Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change
1
+ import * as Command from 'ember-cli/lib/models/command' ;
2
+ import * as Promise from 'ember-cli/lib/ext/promise' ;
3
+ import * as chalk from 'chalk' ;
4
+
5
+
6
+ function pickOne ( of : string [ ] ) : string {
7
+ return of [ Math . floor ( Math . random ( ) * of . length ) ] ;
8
+ }
9
+
10
+
11
+ module . exports = function ( name ) {
12
+ return Command . extend ( {
13
+ name : name ,
14
+ works : 'insideProject' ,
15
+
16
+ run : function ( commandOptions , rawArgs ) : Promise < void > {
17
+ var stringUtils = require ( 'ember-cli/lib/utilities/string' ) ;
18
+ this [ stringUtils . camelize ( this . name ) ] ( commandOptions , rawArgs ) ;
19
+
20
+ return Promise . resolve ( ) ;
21
+ } ,
22
+
23
+ makeThisAwesome : function ( ) {
24
+ const phrase = pickOne ( [
25
+ `You're on it, there's nothing for me to do!` ,
26
+ `Let's take a look... nope, it's all good!` ,
27
+ `You're doing fine.` ,
28
+ `You're already doing great.` ,
29
+ `Nothing to do; already awesome. Exiting.` ,
30
+ `Error 418: As Awesome As Can Get.`
31
+ ] ) ;
32
+ console . log ( chalk . green ( phrase ) ) ;
33
+ }
34
+ } ) ;
35
+ } ;
Original file line number Diff line number Diff line change @@ -17,7 +17,10 @@ module.exports = {
17
17
'doc' : require ( './commands/doc' ) ,
18
18
'github-pages-deploy' : require ( './commands/github-pages-deploy' ) ,
19
19
20
- // Configuration
20
+ // Easter eggs.
21
+ 'make-this-awesome' : require ( './commands/easter-egg' ) ( 'make-this-awesome' ) ,
22
+
23
+ // Configuration.
21
24
'set' : require ( './commands/set' ) ,
22
25
'get' : require ( './commands/get' )
23
26
} ;
You can’t perform that action at this time.
0 commit comments