UNPKG

git-release-manager

Version:

A tool to generate release notes from git commit history

32 lines 1.81 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createChangelogCommand = createChangelogCommand; const commander_1 = require("commander"); const configManager_1 = require("../config/configManager"); const ChangelogController_1 = require("../modules/changelog/ChangelogController"); function createChangelogCommand(program) { const changelogProgram = program .command("changelog") .alias("ch") .description("Changelog helper"); changelogProgram.addCommand(new commander_1.Command() .command("generate") .alias("g") .description("Generate a changelog from commit history") .option("-f, --from <ref>", "Start reference point (commit, tag, branch, or date)") .option("-t, --to <ref>", "End reference point (commit, tag, branch, or date)") .option("-r, --range <range>", "Specify a range of references") .option("-p, --point <commit | tag | branch| date | reference>", "Specify a single reference") .option("-m, --merge-all", "Merge all changes into a single output") .option("--template <path>", "Path to a custom template file") .option("-o, --output <path>", "Path to output the changelog") .option("--dry-run", "Preview the changelog generation without writing") .action(async (args, commandOptions) => { const options = { ...program.opts(), ...commandOptions }; const config = await (0, configManager_1.readConfig)(options === null || options === void 0 ? void 0 : options.config, options.environment); const controller = new ChangelogController_1.ChangelogController(); await controller.handleGenerateCommand(options, config); })); return changelogProgram; } //# sourceMappingURL=changelogCommand.js.map