UNPKG

@salesforce/templates

Version:

Salesforce JS library for templates

36 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 path = require("path"); const i18n_1 = require("../i18n"); const utils_1 = require("../utils"); const sfdxGenerator_1 = require("./sfdxGenerator"); class LightningTestGenerator extends sfdxGenerator_1.SfdxGenerator { constructor(args, options) { super(args, options); this.sourceRootWithPartialPath('lightningtest'); } validateOptions() { utils_1.CreateUtil.checkInputs(this.options.testname); utils_1.CreateUtil.checkInputs(this.options.template); } writing() { const { template, 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(this.outputdir, `${testname}.resource-meta.xml`)), { description: i18n_1.nls.localize('LightningTest'), }, // @ts-ignore { apiName: testname }); } this.fs.copyTpl(this.templatePath(`${template}.resource`), this.destinationPath(path.join(this.outputdir, `${testname}.resource`)), { apiName: testname }); } } exports.default = LightningTestGenerator; //# sourceMappingURL=lightningTestGenerator.js.map