UNPKG

@rnv/engine-core

Version:
37 lines 1.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var core_1 = require("@rnv/core"); exports.default = (0, core_1.createTask)({ description: 'Reapply template (if configured) to current project', dependsOn: [core_1.RnvTaskName.projectConfigure], fn: function (_a) { var ctx = _a.ctx; return tslib_1.__awaiter(void 0, void 0, void 0, function () { var buildConfig, confirm; return tslib_1.__generator(this, function (_b) { switch (_b.label) { case 0: buildConfig = ctx.buildConfig; if (buildConfig === null || buildConfig === void 0 ? void 0 : buildConfig.isTemplate) { return [2 /*return*/, Promise.reject('Template projects cannot use template apply command')]; } (0, core_1.logInfo)('This command will reapply template to current project. files will be overwritten. make sure you backed up your project before proceeding.'); return [4 /*yield*/, (0, core_1.inquirerPrompt)({ type: 'confirm', name: 'confirm', message: 'Proceed?', })]; case 1: confirm = (_b.sent()).confirm; if (!confirm) { return [2 /*return*/]; } return [2 /*return*/, (0, core_1.applyTemplate)()]; } }); }); }, task: core_1.RnvTaskName.templateApply, }); //# sourceMappingURL=taskTemplateApply.js.map