"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.taskRnvInstall = exports["default"] = void 0;var _npmUtils = require("../../core/systemManager/npmUtils");
var _constants = require("../../core/constants");
var _pluginManager = require("../../core/pluginManager");
var _logger = require("../../core/systemManager/logger");function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}

var taskRnvInstall = /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(c, parentTask) {return regeneratorRuntime.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:
            (0, _logger.logTask)('taskRnvInstall', "requiresInstall:".concat(!!c._requiresNpmInstall, ":").concat(!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 (
              (0, _pluginManager.installPackageDependenciesAndPlugins)(c));case 8:return _context.abrupt("return",

            true);case 9:case "end":return _context.stop();}}}, _callee);}));return function taskRnvInstall(_x, _x2) {return _ref.apply(this, arguments);};}();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