Skip to content

Commit

Permalink
fix(cli): fix completion and make-this-awesome command invalid pr…
Browse files Browse the repository at this point in the history
…oblem(#1889)
  • Loading branch information
goorockey committed Aug 30, 2016
1 parent cacaa4e commit 1da309b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
/*eslint-disable no-console */
'use strict';
const Command = require('ember-cli/lib/models/command');
import * as path from 'path';
import * as fs from 'fs';

var Command = require('ember-cli/lib/models/command');
var path = require('path');
var fs = require('fs');

module.exports = Command.extend({
const CompletionCommand = Command.extend({
name: 'completion',
description: 'Adds autocomplete functionality to `ng` commands and subcommands',
works: 'everywhere',
Expand All @@ -16,3 +13,5 @@ module.exports = Command.extend({
console.log(scriptOutput);
}
});

export default CompletionCommand;
48 changes: 24 additions & 24 deletions addon/ng2/commands/easter-egg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ function pickOne(of: string[]): string {
}


export default function(name: string) {
return Command.extend({
name: name,
works: 'insideProject',

run: function (commandOptions: any, rawArgs: string[]): Promise<void> {
(this as any)[stringUtils.camelize(this.name)](commandOptions, rawArgs);

return Promise.resolve();
},

makeThisAwesome: function() {
const phrase = pickOne([
`You're on it, there's nothing for me to do!`,
`Let's take a look... nope, it's all good!`,
`You're doing fine.`,
`You're already doing great.`,
`Nothing to do; already awesome. Exiting.`,
`Error 418: As Awesome As Can Get.`
]);
console.log(chalk.green(phrase));
}
});
};
const MakeThisAwesomeCommand = Command.extend({
name: 'make-this-awesome',
works: 'insideProject',

run: function (commandOptions: any, rawArgs: string[]): Promise<void> {
(this as any)[stringUtils.camelize(this.name)](commandOptions, rawArgs);

return Promise.resolve();
},

makeThisAwesome: function() {
const phrase = pickOne([
`You're on it, there's nothing for me to do!`,
`Let's take a look... nope, it's all good!`,
`You're doing fine.`,
`You're already doing great.`,
`Nothing to do; already awesome. Exiting.`,
`Error 418: As Awesome As Can Get.`
]);
console.log(chalk.green(phrase));
}
});

export default MakeThisAwesomeCommand;

0 comments on commit 1da309b

Please sign in to comment.