generated from salesforcecli/plugin-template-sf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
list.ts
32 lines (25 loc) · 1.29 KB
/
list.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
* Copyright (c) 2020, salesforce.com, inc.
* All rights reserved.
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import { ConfigAggregator, Messages } from '@salesforce/core';
import { loglevel, SfCommand, Ux } from '@salesforce/sf-plugins-core';
import { ConfigResponses, buildSuccessMsg, output } from '../../config.js';
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-settings', 'config.list');
export default class List extends SfCommand<ConfigResponses> {
public static readonly description = messages.getMessage('description');
public static readonly summary = messages.getMessage('summary');
public static readonly examples = messages.getMessages('examples');
public static readonly aliases = ['force:config:list'];
public static readonly deprecateAliases = true;
public static readonly flags = { loglevel };
public async run(): Promise<ConfigResponses> {
const aggregator = await ConfigAggregator.create();
const responses = aggregator.getConfigInfo().map((c) => buildSuccessMsg(c));
output(new Ux({ jsonEnabled: this.jsonEnabled() }), responses, 'list', true);
return responses;
}
}