UNPKG

@salesforce/plugin-templates

Version:

Commands to create metadata from a default or custom template

24 lines 1.02 kB
/* * Copyright (c) 2019, 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 { OrgConfigProperties } from '@salesforce/core'; import { TemplateService } from '@salesforce/templates'; export async function runGenerator({ ux, templates, templateType, opts }) { const templateService = TemplateService.getInstance(); const result = await templateService.create(templateType, opts, templates); ux.log(result.rawOutput); return result; } export const getCustomTemplates = (configAggregator) => { try { // we're still accessing the old `customOrgMetadataTemplates` key, but this is deprecated and we'll use the new key to access the value return configAggregator.getPropertyValue(OrgConfigProperties.ORG_CUSTOM_METADATA_TEMPLATES); } catch (err) { return undefined; } }; //# sourceMappingURL=templateCommand.js.map