UNPKG

@salesforce/templates

Version:

Salesforce JS library for templates

28 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /* * 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 */ const path = require("path"); const utils_1 = require("../utils"); const sfdxGenerator_1 = require("./sfdxGenerator"); class ApexTriggerGenerator extends sfdxGenerator_1.SfdxGenerator { constructor(args, options) { super(args, options); this.sourceRootWithPartialPath('apextrigger'); } validateOptions() { utils_1.CreateUtil.checkInputs(this.options.triggername); utils_1.CreateUtil.checkInputs(this.options.template); } writing() { const { template, triggername, triggerevents, sobject } = this.options; this.fs.copyTpl(this.templatePath(`${template}.trigger`), this.destinationPath(path.join(this.outputdir, `${triggername}.trigger`)), { triggername, sobject, triggerEvents: triggerevents }); this.fs.copyTpl(this.templatePath('_trigger.trigger-meta.xml'), this.destinationPath(path.join(this.outputdir, `${triggername}.trigger-meta.xml`)), { apiVersion: this.apiversion }); } } exports.default = ApexTriggerGenerator; //# sourceMappingURL=apexTriggerGenerator.js.map