@salesforce/plugin-release-management
Version:
A plugin for preparing and publishing npm packages
37 lines • 1.65 kB
JavaScript
;
/*
* 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
*/
Object.defineProperty(exports, "__esModule", { value: true });
const os_1 = require("os");
const command_1 = require("@salesforce/command");
const core_1 = require("@salesforce/core");
const repositories_1 = require("../../repositories");
core_1.Messages.importMessagesDirectory(__dirname);
const messages = core_1.Messages.loadMessages('@salesforce/plugin-release-management', 'circleci');
class CircleCI extends command_1.SfdxCommand {
async run() {
let repositories = await (0, repositories_1.retrieveKnownRepositories)();
if (this.flags['contains-package-type']) {
const packageType = this.flags['contains-package-type'];
repositories = repositories.filter((repository) => repository.packages.find((pkg) => pkg.type === packageType));
}
const slugs = repositories.map((plugin) => `gh/${/https:\/\/github.com\/([\w_-]+\/[\w_-]+)/.exec(plugin.url)[1]}`);
this.ux.log(slugs.join('\n'));
return slugs;
}
}
exports.default = CircleCI;
CircleCI.description = messages.getMessage('list.description');
CircleCI.examples = messages.getMessage('list.examples').split(os_1.EOL);
CircleCI.flagsConfig = {
'contains-package-type': command_1.flags.enum({
description: messages.getMessage('list.flags.type'),
char: 't',
options: ['plugin', 'library', 'orb'],
}),
};
//# sourceMappingURL=index.js.map