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 589e276
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 42 deletions.
18 changes: 0 additions & 18 deletions addon/ng2/commands/completion.js

This file was deleted.

17 changes: 17 additions & 0 deletions addon/ng2/commands/completion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const Command = require('ember-cli/lib/models/command');
import * as path from 'path';
import * as fs from 'fs';

const CompletionCommand = Command.extend({
name: 'completion',
description: 'Adds autocomplete functionality to `ng` commands and subcommands',
works: 'everywhere',
run: function() {
let scriptPath = path.resolve(__dirname, '..', 'utilities', 'completion.sh');
let scriptOutput = fs.readFileSync(scriptPath, 'utf8');

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 589e276

Please sign in to comment.