UNPKG

@happy-coders/fun-cli

Version:

Be your project management more fun!

29 lines (28 loc) 1.19 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.buildProject = void 0; var tslib_1 = require("tslib"); var inquirer = tslib_1.__importStar(require("inquirer")); var project_entity_1 = require("../project.entity"); var task_factory_1 = require("../tasks/task.factory"); var questions_builder_1 = require("./questions.builder"); function buildProject(alias, path) { return tslib_1.__awaiter(this, void 0, void 0, function () { var questions, answers, project; return tslib_1.__generator(this, function (_a) { switch (_a.label) { case 0: questions = questions_builder_1.buildProjectQuestions(); return [4 /*yield*/, inquirer.prompt(questions)]; case 1: answers = _a.sent(); project = new project_entity_1.Project(alias, path); answers.tasks.forEach(function (action) { project.addTask(task_factory_1.createTask(action)); }); return [2 /*return*/, project]; } }); }); } exports.buildProject = buildProject;