r8s-cli
Version:
A command line tool for Reaction Commerce to be used with kubernetes
48 lines (37 loc) • 1.62 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
var _utils = require('../../utils');
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
exports.default = function () {
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(_id) {
var gql, result;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
gql = new _utils.GraphQL();
_context.next = 3;
return gql.fetch('\n query app($_id: ID!) {\n app(_id: $_id){\n env\n }\n }\n ', { _id: _id });
case 3:
result = _context.sent;
if (!!result.errors) {
result.errors.forEach(function (err) {
_utils.Log.error(err.message);
});
process.exit(1);
}
return _context.abrupt('return', result.data.app.env);
case 6:
case 'end':
return _context.stop();
}
}
}, _callee, this);
}));
function envList(_x) {
return _ref.apply(this, arguments);
}
return envList;
}();
;