salesforcedx-templates
Version:
Salesforce CLI scaffolding commands for different types of Force.com metadata
35 lines • 1.61 kB
JavaScript
;
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 core_1 = require("@salesforce/core");
const path = require("path");
// tslint:disable-next-line:no-var-requires
const generator = require('yeoman-generator');
core_1.Messages.importMessagesDirectory(__dirname);
const messages = core_1.Messages.loadMessages('salesforcedx-templates', 'messages');
class LightningEventGenerator extends generator {
constructor(args, options) {
super(args, options);
this.sourceRoot(path.join(__dirname, '..', 'templates', 'lightningevent'));
this.conflicter.force = false;
}
writing() {
const { template, outputdir, eventname, apiversion, internal } = this.options;
// tslint:disable-next-line:no-unused-expression
if (!internal) {
this.fs.copyTpl(this.templatePath('_auradefinitionbundle.evt-meta.xml'), this.destinationPath(path.join(outputdir, eventname, `${eventname}.evt-meta.xml`)), {
eventname,
apiVersion: apiversion,
description: messages.getMessage('LightningEventBundle')
});
}
this.fs.copyTpl(this.templatePath(`${template}.evt`), this.destinationPath(path.join(outputdir, eventname, `${eventname}.evt`)));
}
}
exports.default = LightningEventGenerator;
//# sourceMappingURL=lightningEventGenerator.js.map