UNPKG

cr-react-cli

Version:

Create react files with a single command

26 lines (25 loc) 1.05 kB
var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); // Libs const commander_1 = require("commander"); // Base const base_command_1 = __importDefault(require("../base.command")); class CreateHookCommand extends base_command_1.default { build() { return new commander_1.Command('hook') .alias('h') .arguments('<name>') .description('create hook') .option('-t, --typescript', 'Use typescript') .option('-notp, --no-typescript', "Don't use typescript") .option('--path', 'Specify the path for the file relative to the project source path defined in the project configuration entry') .action((name, params) => { const inputs = { name }; const options = this.parseOptions(params); this.action.handle(inputs, options); }); } } exports.default = CreateHookCommand;