salesforcedx-templates
Version:
Salesforce CLI scaffolding commands for different types of Force.com metadata
25 lines • 1.19 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 path = require("path");
// tslint:disable-next-line:no-var-requires
const generator = require('yeoman-generator');
class ApexClassGenerator extends generator {
constructor(args, options) {
super(args, options);
this.sourceRoot(path.join(__dirname, '..', 'templates', 'apexclass'));
this.conflicter.force = false;
}
writing() {
const { template, outputdir, classname, apiversion } = this.options;
this.fs.copyTpl(this.templatePath(`${template}.cls`), this.destinationPath(path.join(outputdir, `${classname}.cls`)), { apiName: classname }),
this.fs.copyTpl(this.templatePath('_class.cls-meta.xml'), this.destinationPath(path.join(outputdir, `${classname}.cls-meta.xml`)), { apiName: classname, apiVersion: apiversion });
}
}
exports.default = ApexClassGenerator;
//# sourceMappingURL=apexClassGenerator.js.map