HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //proc/self/root/usr/local/lib/node_modules/@ionic/cli/commands/info.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InfoCommand = void 0;
const tslib_1 = require("tslib");
const string_1 = require("@ionic/cli-framework/utils/string");
const utils_terminal_1 = require("@ionic/utils-terminal");
const lodash = tslib_1.__importStar(require("lodash"));
const color_1 = require("../lib/color");
const command_1 = require("../lib/command");
const INFO_GROUPS = ['ionic', 'capacitor', 'cordova', 'utility', 'system', 'environment'];
class InfoCommand extends command_1.Command {
    async getMetadata() {
        return {
            name: 'info',
            type: 'global',
            summary: 'Print project, system, and environment information',
            description: `
This command is an easy way to share information about your setup. If applicable, be sure to run ${(0, color_1.input)('ionic info')} within your project directory to display even more information.
      `,
            options: [
                {
                    name: 'json',
                    summary: 'Print system/environment info in JSON format',
                    type: Boolean,
                },
            ],
        };
    }
    async run(inputs, options) {
        const { json } = options;
        const items = (await this.env.getInfo()).filter(item => item.hidden !== true);
        if (json) {
            process.stdout.write(JSON.stringify(items));
        }
        else {
            const groupedInfo = new Map(INFO_GROUPS.map((group) => [group, items.filter(item => item.group === group)]));
            const sortInfo = (a, b) => {
                if (a.name[0] === '@' && b.name[0] !== '@') {
                    return 1;
                }
                if (a.name[0] !== '@' && b.name[0] === '@') {
                    return -1;
                }
                return (0, string_1.strcmp)(a.name.toLowerCase(), b.name.toLowerCase());
            };
            const projectPath = this.project && this.project.directory;
            const splitInfo = (ary) => ary
                .sort(sortInfo)
                .map((item) => [`   ${item.name}${item.flair ? ' ' + (0, color_1.weak)('(' + item.flair + ')') : ''}`, (0, color_1.weak)(item.value) + (item.path && projectPath && !item.path.startsWith(projectPath) ? ` ${(0, color_1.weak)('(' + item.path + ')')}` : '')]);
            const format = (details) => (0, utils_terminal_1.columnar)(details, { vsep: ':' });
            if (!projectPath) {
                this.env.log.warn('You are not in an Ionic project directory. Project context may be missing.');
            }
            this.env.log.nl();
            for (const [group, info] of groupedInfo.entries()) {
                if (info.length > 0) {
                    this.env.log.rawmsg(`${(0, color_1.strong)(`${lodash.startCase(group)}:`)}\n\n`);
                    this.env.log.rawmsg(`${format(splitInfo(info))}\n\n`);
                }
            }
        }
    }
}
exports.InfoCommand = InfoCommand;