var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.taskRnvHooksRun=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _logger=require("../core/systemManager/logger");
var _buildHooks=require("../core/projectManager/buildHooks");
var _engineManager=require("../core/engineManager");
var _constants=require("../core/constants");


var taskRnvHooksRun=function taskRnvHooksRun(c,parentTask,originTask){var _c$program;var _c$program2;return _regenerator.default.async(function taskRnvHooksRun$(_context){while(1){switch(_context.prev=_context.next){case 0:
(0,_logger.logTask)('taskRnvHooksRun');_context.next=3;return _regenerator.default.awrap(

(0,_engineManager.executeTask)(c,_constants.TASK_PROJECT_CONFIGURE,_constants.TASK_HOOKS_RUN,originTask));case 3:_context.next=5;return _regenerator.default.awrap(

(0,_buildHooks.buildHooks)(c));case 5:if(

c.buildHooks){_context.next=7;break;}return _context.abrupt("return",
Promise.reject('Build hooks have not been compiled properly!'));case 7:if(!

c.buildHooks[(_c$program=c.program)==null?void 0:_c$program.exeMethod]){_context.next=12;break;}_context.next=10;return _regenerator.default.awrap(
c.buildHooks[(_c$program2=c.program)==null?void 0:_c$program2.exeMethod](c));case 10:_context.next=13;break;case 12:return _context.abrupt("return",

Promise.reject("Method name "+
(0,_logger.chalk)().white(
c.program.exeMethod)+" does not exists in your buildHooks!"));case 13:return _context.abrupt("return",



true);case 14:case"end":return _context.stop();}}},null,null,null,Promise);};exports.taskRnvHooksRun=taskRnvHooksRun;var _default=


{
description:'Run specific build hook',
fn:taskRnvHooksRun,
task:_constants.TASK_HOOKS_RUN,
params:_constants.PARAMS.withBase(),
platforms:[],
skipAppConfig:true,
skipPlatforms:true};exports.default=_default;
//# sourceMappingURL=task.rnv.hooks.run.js.map