UNPKG

tg-commander

Version:

<p align="center"><img src="https://github.com/stone-jin/tg-commander/raw/master/assets/logo.png" alt="tg-commander logo" width="150px" height="150px"></p>

73 lines (72 loc) 3.07 kB
#!/usr/bin/env node "use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); var lib_1 = require("../lib"); var hello_1 = require("./hello"); var HelloCommand = /** @class */ (function () { function HelloCommand(helloService) { this.helloService = helloService; } HelloCommand.prototype.hello = function (cmd, env) { console.log(cmd, env); console.log(this.helloService.name); }; HelloCommand.prototype.createModule = function (module) { console.log(this.type); console.log("you want to create module: " + module); console.log(this.target); console.log("===="); }; HelloCommand.prototype.newProduct = function (product) { console.log(process.cwd()); console.log("you want to create product: " + product); }; __decorate([ lib_1.TgOptions("-p, --peppers [type]", "Add peppers"), __metadata("design:type", String) ], HelloCommand.prototype, "type", void 0); __decorate([ lib_1.TgOptions("-t, --target [taget]", "Add peppers", "dev"), __metadata("design:type", String) ], HelloCommand.prototype, "target", void 0); __decorate([ lib_1.Command("rmdir <cmd> [env]"), __metadata("design:type", Function), __metadata("design:paramtypes", [Object, Object]), __metadata("design:returntype", void 0) ], HelloCommand.prototype, "hello", null); __decorate([ lib_1.Command({ cmd: "g <module>", description: "create module", }), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0) ], HelloCommand.prototype, "createModule", null); __decorate([ lib_1.Command({ cmd: "new <product>", alias: "n", description: "new product", }), __metadata("design:type", Function), __metadata("design:paramtypes", [String]), __metadata("design:returntype", void 0) ], HelloCommand.prototype, "newProduct", null); HelloCommand = __decorate([ lib_1.TgCommand, __metadata("design:paramtypes", [hello_1.HelloService]) ], HelloCommand); return HelloCommand; }()); exports.HelloCommand = HelloCommand;