Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): fix completion and make-this-awesome command invalid(#1889) #1890

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions packages/angular-cli/commands/completion.js

This file was deleted.

17 changes: 17 additions & 0 deletions packages/angular-cli/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 packages/angular-cli/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;