Skip to content

Commit

Permalink
chore(commands): override ng destroy
Browse files Browse the repository at this point in the history
It's common for users to try and do `ng destroy component name` and have
it only partially work.

Since we don't support the command, it's better to not have it do any
partial operations.
  • Loading branch information
filipesilva committed Oct 17, 2016
1 parent b250cb6 commit f3d399f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/angular-cli/addon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = {
'serve': require('../commands/serve').default,
'new': require('../commands/new').default,
'generate': require('../commands/generate').default,
'destroy': require('../commands/destroy').default,
'init': require('../commands/init').default,
'test': require('../commands/test').default,
'e2e': require('../commands/e2e').default,
Expand Down
20 changes: 20 additions & 0 deletions packages/angular-cli/commands/destroy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const Command = require('ember-cli/lib/models/command');
const SilentError = require('silent-error');


const DestroyCommand = Command.extend({
name: 'destroy',
aliases: ['d'],
works: 'insideProject',

anonymousOptions: [
'<blueprint>'
],

run: function() {
return Promise.reject(new SilentError('The destroy command is not supported by Angular-CLI.'));
}
});

export default DestroyCommand;
DestroyCommand.overrideCore = true;
1 change: 1 addition & 0 deletions packages/angular-cli/commands/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const lookupCommand = require('ember-cli/lib/cli/lookup-command');

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

Expand Down

0 comments on commit f3d399f

Please sign in to comment.