"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.taskRnvFastlane = exports["default"] = void 0;var _exec = require("../../core/systemManager/exec");
var _common = require("../../core/common");
var _constants = require("../../core/constants");






var _setupManager = _interopRequireDefault(require("../../core/setupManager"));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { "default": obj };}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}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 taskRnvFastlane = /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(c) {var args, setupInstance, appFolder, fastlaneArgs;return regeneratorRuntime.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:
            args = (0, _common.getCliArguments)(c);
            args.shift(); // we know the first one is fastlane, trash it
            if (
            (0, _exec.commandExistsSync)('fastlane')) {_context.next = 6;break;}
            setupInstance = (0, _setupManager["default"])();_context.next = 6;return (
              setupInstance.askToInstallSDK('fastlane'));case 6:


            appFolder = (0, _common.getAppFolder)(c, c.platform);

            fastlaneArgs = _toConsumableArray(c.program.rawArgs);
            fastlaneArgs = fastlaneArgs.slice(3);return _context.abrupt("return",

            (0, _exec.executeAsync)(c, "fastlane ".concat(fastlaneArgs.join(' ')), {
              interactive: true,
              env: process.env,
              cwd: appFolder }));case 10:case "end":return _context.stop();}}}, _callee);}));return function taskRnvFastlane(_x) {return _ref.apply(this, arguments);};}();exports.taskRnvFastlane = taskRnvFastlane;var _default =



{
  description: 'Run fstalane commands directly',
  fn: taskRnvFastlane,
  task: 'fastlane',
  params: _constants.PARAMS.withBase(),
  platforms: [
  _constants.IOS,
  _constants.TVOS,
  _constants.ANDROID,
  _constants.ANDROID_TV,
  _constants.FIRE_TV,
  _constants.ANDROID_WEAR] };exports["default"] = _default;
//# sourceMappingURL=task.rnv.fastlane.js.map