All files / src/commands/config config.get.command.js

80.95% Statements 17/21
100% Branches 1/1
0% Functions 0/1
80.95% Lines 17/21

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x         193x 193x  
import { defineCommand } from '../../lib/define-command.js';
import * as Application from '../../models/application.js';
import * as ApplicationConfiguration from '../../models/application_configuration.js';
import { aliasOption, appIdOrNameOption } from '../global.options.js';
import { configurationNameArg } from './config.args.js';
 
export const configGetCommand = defineCommand({
  description: 'Display the current configuration',
  since: '2.5.0',
  options: {
    alias: aliasOption,
    app: appIdOrNameOption,
  },
  args: [configurationNameArg],
  async handler(options, configurationName) {
    const { alias, app: appIdOrName } = options;
    const { ownerId, appId } = await Application.resolveId(appIdOrName, alias);
    const app = await Application.get(ownerId, appId);
    ApplicationConfiguration.printValue(app, configurationName);
  },
});