var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.configureDeploymentIfRequired=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _config=_interopRequireDefault(require("../config"));
var _prompt=require("../systemTools/prompt");
var _setupTools=_interopRequireDefault(require("../setupTools"));
var _exec=require("../systemTools/exec");

var configureDeploymentIfRequired=function configureDeploymentIfRequired(deploymentTarget){var projectConfig,_ref,confirm,setupInstance;return _regenerator.default.async(function configureDeploymentIfRequired$(_context){while(1){switch(_context.prev=_context.next){case 0:
projectConfig=_config.default.getProjectConfig();if(!(

deploymentTarget==='docker')){_context.next=14;break;}if(
projectConfig.package.dependencies['@rnv/deploy-docker']){_context.next=14;break;}_context.next=5;return _regenerator.default.awrap(
(0,_prompt.inquirerPrompt)({
type:'confirm',
message:'You do not have Docker deployment configured. Do you want to configure it now?'}));case 5:_ref=_context.sent;confirm=_ref.confirm;if(!


confirm){_context.next=14;break;}if(
(0,_exec.commandExistsSync)('docker')){_context.next=12;break;}
setupInstance=(0,_setupTools.default)();_context.next=12;return _regenerator.default.awrap(
setupInstance.askToInstallSDK('docker'));case 12:_context.next=14;return _regenerator.default.awrap(


_config.default.injectProjectDependency('@rnv/deploy-docker','latest'));case 14:case"end":return _context.stop();}}});};exports.configureDeploymentIfRequired=configureDeploymentIfRequired;