UNPKG

salesforcedx-templates

Version:

Salesforce CLI scaffolding commands for different types of Force.com metadata

33 lines 1.56 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 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 LightningTestGenerator extends generator { constructor(args, options) { super(args, options); this.sourceRoot(path.join(__dirname, '..', 'templates', 'lightningtest')); this.conflicter.force = false; } writing() { const { template, outputdir, testname, internal } = this.options; // tslint:disable-next-line:no-unused-expression if (!internal) { this.fs.copyTpl(this.templatePath('_staticresource.resource-meta.xml'), this.destinationPath(path.join(outputdir, `${testname}.resource-meta.xml`)), { description: messages.getMessage('LightningTest') }, { apiName: testname }); } this.fs.copyTpl(this.templatePath(`${template}.resource`), this.destinationPath(path.join(outputdir, `${testname}.resource`)), { apiName: testname }); } } exports.default = LightningTestGenerator; //# sourceMappingURL=lightningTestGenerator.js.map