decova-gotcha
Version:
It's my personal trial for automating daunting tasks
68 lines • 4 kB
JavaScript
;
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DevelopMyTools_Poyka = void 0;
const decova_terminal_1 = require("decova-terminal");
const tsyringe_1 = require("tsyringe");
const PathMan_1 = require("../../../local-tools-impl/Techies/PathMan");
let DevelopMyTools_Poyka = class DevelopMyTools_Poyka {
constructor() {
this.srv_PathMan = tsyringe_1.container.resolve(PathMan_1.PathMan);
this._projectDir = "G:\\_MyProjects\\_MyNodeProjects\\Poyka";
}
_NewBranch() {
return __awaiter(this, void 0, void 0, function* () {
yield decova_terminal_1.CurrentTerminal.InstructAsync("Create [/src/MyBranch/MyBranch.ts]", 'Press ENTER when done.');
yield decova_terminal_1.CurrentTerminal.InstructAsync("Create public static TakeControl() method and use it in the designed place.", 'Press ENTER when done');
});
}
_EditCodeSnippets() {
return __awaiter(this, void 0, void 0, function* () {
decova_terminal_1.CurrentTerminal.Exec(`cd "${this._projectDir}"`);
yield decova_terminal_1.CurrentTerminal.HintBeforeLaunchAsync('Press ENTER to take you to Poyka/snippets');
decova_terminal_1.CurrentTerminal.Exec(`code ${this._projectDir}`);
decova_terminal_1.CurrentTerminal.Exec(`code ` + this.srv_PathMan.CurrentWorkspace_DecovaSnippets.FullName);
yield decova_terminal_1.CurrentTerminal.InstructAsync(`Make your edits!`, `$$$Press ENTER when done!`);
yield decova_terminal_1.CurrentTerminal.ConfirmAsync(`Ready for publishing Poyka?`);
decova_terminal_1.CurrentTerminal.Exec('g "++"');
yield decova_terminal_1.CurrentTerminal.InstructAsync('Ctrl + Shift + B >> Build & Publish', `VOILA`);
});
}
TakeControl() {
return __awaiter(this, void 0, void 0, function* () {
let ops = { newBranch: 'New branch',
editCodeSnippets: 'Edit code snippets'
};
let selected = yield decova_terminal_1.CurrentTerminal.McqAsync('To do in Poyka:', ops);
switch (selected) {
case ops.newBranch:
this._NewBranch();
break;
case ops.editCodeSnippets:
this._EditCodeSnippets();
break;
default:
throw new Error('Unplanned execution path!');
}
});
}
};
DevelopMyTools_Poyka = __decorate([
(0, tsyringe_1.singleton)()
], DevelopMyTools_Poyka);
exports.DevelopMyTools_Poyka = DevelopMyTools_Poyka;
//# sourceMappingURL=DevelopMyTools_Poyka.js.map