Skip to content
Merged
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.

18 changes: 18 additions & 0 deletions packages/angular-cli/commands/completion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as path from 'path';
import * as fs from 'fs';

const Command = require('ember-cli/lib/models/command');

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

console.log(scriptOutput);
}
});

export default CompletionCommand;
8 changes: 3 additions & 5 deletions packages/angular-cli/commands/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ const stringUtils = require('ember-cli-string-utils');
const lookupCommand = require('ember-cli/lib/cli/lookup-command');

const commandsToIgnore = [
'help',
'easter-egg',
'completion',
'github-pages-deploy'
'github-pages-deploy' // errors because there is no base github-pages command
];

const HelpCommand = Command.extend({
Expand All @@ -21,8 +19,8 @@ const HelpCommand = Command.extend({

run: function (commandOptions: any) {
let commandFiles = fs.readdirSync(__dirname)
// Remove files that are not JavaScript
.filter(file => file.match(/\.js$/))
// Remove files that are not JavaScript or Typescript
.filter(file => file.match(/\.(j|t)s$/) && !file.match(/\.d.ts$/))
.map(file => path.parse(file).name)
.map(file => file.toLowerCase());

Expand Down