var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.taskRnvCryptoUpdateProfiles=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _logger=require("../core/systemManager/logger");
var _configParser=require("../core/configManager/configParser");
var _constants=require("../core/constants");
var _fastlane=require("../sdk-xcode/fastlane");
var _engineManager=require("../core/engineManager");


var _updateProfile=function _updateProfile(c,v){return new Promise(function(resolve,reject){
(0,_logger.logTask)("_updateProfile:"+v,(0,_logger.chalk)().grey);
(0,_fastlane.updateProfile)(c,v).
then(function(){return resolve();}).
catch(function(e){return reject(e);});
});};

var _updateProfiles=function _updateProfiles(c){
(0,_logger.logTask)('_updateProfiles',(0,_logger.chalk)().grey);
var acList=(0,_configParser.listAppConfigsFoldersSync)(c,true);

return acList.reduce(
function(previousPromise,v){return previousPromise.then(function(){return _updateProfile(c,v);});},
Promise.resolve());

};

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

(0,_engineManager.executeTask)(c,_constants.TASK_PROJECT_CONFIGURE,_constants.TASK_CRYPTO_UPDATE_PROFILES,originTask));case 3:_context.t0=

c.platform;_context.next=_context.t0===
_constants.IOS?6:_context.t0===
_constants.TVOS?6:9;break;case 6:_context.next=8;return _regenerator.default.awrap(
_updateProfiles(c));case 8:return _context.abrupt("break",10);case 9:return _context.abrupt("return",


true);case 10:return _context.abrupt("return",

Promise.reject("updateProfiles: Platform "+
c.platform+" not supported"));case 11:case"end":return _context.stop();}}},null,null,null,Promise);};exports.taskRnvCryptoUpdateProfiles=taskRnvCryptoUpdateProfiles;var _default=



{
description:'',
fn:taskRnvCryptoUpdateProfiles,
task:_constants.TASK_CRYPTO_UPDATE_PROFILES,
params:_constants.PARAMS.withBase(),
platforms:[],
skipPlatforms:true};exports.default=_default;
//# sourceMappingURL=task.rnv.crypto.updateProfiles.js.map