denali-js/core

View on GitHub
commands/destroy.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Command, Blueprint, unwrap } from '@denali-js/cli';

/**
 * Remove scaffolded code from your app
 *
 * @package commands
 */
export default class DestroyCommand extends Command {

  /* tslint:disable:completed-docs typedef */
  static commandName = 'destroy';
  static description = 'Remove scaffolded code from your app';
  static longDescription = unwrap`
    Removes the code generated during a \`denali generate\` command. Errs on the
    side of caution when deleting code - it will only remove files that exactly
    match the generated output. Modified files will be left untouched. `;

  static params = '<blueprint>';

  static flags = {
    skipPostUninstall: {
      description: "Don't run any post uninstall hooks for the blueprint",
      default: false,
      type: <any>'boolean'
    }
  };

  protected static configureSubcommands(commandName: string, yargs: any, projectPkg: any): any {
    return Blueprint.findAndConfigureBlueprints(yargs, 'destroy', projectPkg);
  }

}