eas-cli
Version:
EAS command line tool
44 lines (43 loc) • 1.82 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const chalk_1 = tslib_1.__importDefault(require("chalk"));
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
const flags_1 = require("../../commandUtils/flags");
const UpdateQuery_1 = require("../../graphql/queries/UpdateQuery");
const log_1 = tslib_1.__importDefault(require("../../log"));
const utils_1 = require("../../update/utils");
const json_1 = require("../../utils/json");
class UpdateView extends EasCommand_1.default {
static description = 'update group details';
static args = [
{
name: 'groupId',
required: true,
description: 'The ID of an update group.',
},
];
static flags = {
...flags_1.EasJsonOnlyFlag,
};
static contextDefinition = {
...this.ContextOptions.LoggedIn,
};
async runAsync() {
const { args: { groupId }, flags: { json: jsonFlag }, } = await this.parse(UpdateView);
const { loggedIn: { graphqlClient }, } = await this.getContextAsync(UpdateView, { nonInteractive: true });
if (jsonFlag) {
(0, json_1.enableJsonOutput)();
}
const updatesByGroup = await UpdateQuery_1.UpdateQuery.viewUpdateGroupAsync(graphqlClient, { groupId });
if (jsonFlag) {
(0, json_1.printJsonOnlyOutput)((0, utils_1.getUpdateJsonInfosForUpdates)(updatesByGroup));
}
else {
const [updateGroupDescription] = (0, utils_1.getUpdateGroupDescriptions)([updatesByGroup]);
log_1.default.log(chalk_1.default.bold('Update group:'));
log_1.default.log((0, utils_1.formatUpdateGroup)(updateGroupDescription));
}
}
}
exports.default = UpdateView;
;