UNPKG

@salesforce/plugin-release-management

Version:
47 lines 1.67 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 command_1 = require("@salesforce/command"); const core_1 = require("@salesforce/core"); const package_1 = require("../../../package"); core_1.Messages.importMessagesDirectory(__dirname); const messages = core_1.Messages.loadMessages('@salesforce/plugin-release-management', 'npm.dependencies.pin'); class Pin extends command_1.SfdxCommand { async run() { const packageJson = await package_1.Package.create(); const pkg = packageJson.pinDependencyVersions(this.flags.tag); if (this.flags.dryrun) { this.warn('Running in --dryrun mode. No changes will be written to the package.json.'); } else { packageJson.writePackageJson(); } this.ux.table(pkg, { name: { header: 'Name' }, version: { header: 'Version' }, tag: { header: 'Tag' }, alias: { header: 'Alias' }, }); return pkg; } } exports.default = Pin; Pin.description = messages.getMessage('description'); Pin.flagsConfig = { dryrun: command_1.flags.boolean({ char: 'd', default: false, description: messages.getMessage('flags.dryrun'), }), tag: command_1.flags.string({ char: 't', description: messages.getMessage('flags.tag'), default: 'latest', }), }; //# sourceMappingURL=pin.js.map