UNPKG

@salesforce/templates

Version:

Salesforce JS library for templates

28 lines 1.29 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /* * Copyright (c) 2020, 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 VisualforcePageGenerator extends sfdxGenerator_1.SfdxGenerator { constructor(args, options) { super(args, options); this.sourceRootWithPartialPath('visualforcepage'); } validateOptions() { utils_1.CreateUtil.checkInputs(this.options.pagename); utils_1.CreateUtil.checkInputs(this.options.template); } writing() { const { template, label, pagename } = this.options; this.fs.copyTpl(this.templatePath(`${template}.page`), this.destinationPath(path.join(this.outputdir, `${pagename}.page`)), {}); this.fs.copyTpl(this.templatePath('_page.page-meta.xml'), this.destinationPath(path.join(this.outputdir, `${pagename}.page-meta.xml`)), { vfLabel: label, apiVersion: this.apiversion }); } } exports.default = VisualforcePageGenerator; //# sourceMappingURL=visualforcePageGenerator.js.map