var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.PIPES=void 0;var _path=_interopRequireDefault(require("path"));
var _fs=_interopRequireDefault(require("fs"));
var _shelljs=_interopRequireDefault(require("shelljs"));
var _common=require("../common");
















var _constants=require("../constants");
var _exec=require("../systemTools/exec");
var _cleaner=require("../systemTools/cleaner");
var _logger=require("../systemTools/logger");
var _doctor=require("../systemTools/doctor");
var _crypto2=require("../systemTools/crypto");
var _fastlane=require("../platformTools/apple/fastlane");
var _buildHooks=require("../projectTools/buildHooks");
var _projectParser=require("../projectTools/projectParser");
var _android=require("../platformTools/android");






var _app=_interopRequireWildcard(require("./app"));


var FIX='fix';
var CLEAN='clean';
var STATUS='status';
var CRYPTO='crypto';


var FIX_PACKAGE='fixPackage';
var ENCRYPT='encrypt';
var DECRYPT='decrypt';
var INSTALL_PROFILES='installProfiles';
var UPDATE_PROFILES='updateProfiles';
var UPDATE_PROFILE='updateProfile';
var INSTALL_CERTS='installCerts';

var PIPES={
FIX_BEFORE:'fix:before',
FIX_AFTER:'fix:after'};exports.PIPES=PIPES;






var run=function run(c){
(0,_common.logTask)('run');

switch(c.command){
case FIX:
return _fix(c);
case CLEAN:
return(0,_cleaner.cleanProjectModules)(c);
case STATUS:
return _status(c);
case CRYPTO:
return _crypto(c);}


switch(c.subCommand){
case FIX_PACKAGE:
return(0,_doctor.fixPackageJson)(c);}


return Promise.reject("cli:tools: Command "+c.command+" "+c.subCommand+" not supported");
};





var _fix=function _fix(c){return new Promise(function(resolve,reject){
(0,_projectParser.cleanNodeModules)(c).then(function(){return resolve();}).catch(function(e){return reject(e);});
});};

var _crypto=function _crypto(c){return new Promise(function(resolve,reject){
switch(c.subCommand){
case ENCRYPT:
(0,_crypto2.encrypt)(c).
then(function(){return resolve();}).
catch(function(e){return reject(e);});
return;
case DECRYPT:
(0,_crypto2.decrypt)(c).
then(function(){return resolve();}).
catch(function(e){return reject(e);});
return;
case INSTALL_PROFILES:
(0,_crypto2.installProfiles)(c).
then(function(){return resolve();}).
catch(function(e){return reject(e);});
return;
case UPDATE_PROFILES:
(0,_crypto2.updateProfiles)(c).
then(function(){return resolve();}).
catch(function(e){return reject(e);});
return;
case UPDATE_PROFILE:
(0,_fastlane.updateProfile)(c).
then(function(){return resolve();}).
catch(function(e){return reject(e);});
return;
case INSTALL_CERTS:
(0,_crypto2.installCerts)(c).
then(function(){return resolve();}).
catch(function(e){return reject(e);});
return;}


reject("cli:tools: Command "+c.command+" "+c.subCommand+" not supported");
});};

var _status=function _status(c){return new Promise(function(resolve,reject){
(0,_logger.logStatus)();
resolve();
});};var _default=



run;exports.default=_default;