UNPKG

firebase-tools

Version:
33 lines (32 loc) • 1.45 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.command = void 0; const clc = require("colorette"); const Table = require("cli-table3"); const command_1 = require("../command"); const logger_1 = require("../logger"); const projectUtils_1 = require("../projectUtils"); const requireAuth_1 = require("../requireAuth"); const profilingManager_1 = require("../crashlytics/profilingManager"); exports.command = new command_1.Command("crashlytics:heapdumps:status") .description("get Crashlytics heap dump collection status and configuration for an Android app") .option("--app <appID>", "the app id of your Firebase Android app") .before(requireAuth_1.requireAuth) .action(async (options) => { const projectId = (0, projectUtils_1.needProjectId)(options); const appId = await (0, profilingManager_1.resolveAndroidAppId)(projectId, options); const config = await (0, profilingManager_1.getProfilingManagerConfig)(appId); const tableHead = ["App ID", "Collection Status", "Cloud Storage Bucket"]; const table = new Table({ head: tableHead, style: { head: ["green"] } }); table.push([ appId, config.heapDumpCollectionEnabled ? clc.green("Enabled") : clc.red("Disabled"), config.gcsBucket || clc.yellow("(none)"), ]); logger_1.logger.info(""); logger_1.logger.info(table.toString()); return { appId, ...config, }; });