var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.taskRnvInstall=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _npmUtils=require("../../core/systemManager/npmUtils");
var _constants=require("../../core/constants");
var _pluginManager=require("../../core/pluginManager");
var _logger=require("../../core/systemManager/logger");

var taskRnvInstall=function taskRnvInstall(c,parentTask){return _regenerator.default.async(function taskRnvInstall$(_context){while(1){switch(_context.prev=_context.next){case 0:
(0,_logger.logTask)('taskRnvInstall',"requiresInstall:"+!!c._requiresNpmInstall+":"+!c.runtime.skipPackageUpdate);if(!(

c.program.only&&!!parentTask)){_context.next=3;break;}return _context.abrupt("return",true);case 3:if(!(


!(0,_npmUtils.areNodeModulesInstalled)()||c._requiresNpmInstall&&!c.runtime.skipPackageUpdate)){_context.next=8;break;}
if(!(0,_npmUtils.areNodeModulesInstalled)()){
(0,_logger.logInfo)(
'node_modules folder is missing. INSTALLING...');

}else{
(0,_logger.logInfo)(
'node_modules folder is out of date. INSTALLING...');

}
c._requiresNpmInstall=false;_context.next=8;return _regenerator.default.awrap(
(0,_pluginManager.installPackageDependenciesAndPlugins)(c));case 8:return _context.abrupt("return",

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


{
description:'Install package node_modules via yarn or npm',
fn:taskRnvInstall,
task:'install',
params:_constants.PARAMS.withBase(),
platforms:[],
skipPlatforms:true};exports.default=_default;
//# sourceMappingURL=task.rnv.install.js.map