release-notes-cli
Version:
Generate release notes from git for playstore/appstore or github
82 lines (81 loc) • 3.26 kB
JavaScript
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.run = void 0;
const chalk = require("chalk");
const index_1 = require("./index");
function run() {
return __awaiter(this, void 0, void 0, function* () {
const argv = require("yargs")
.usage("release-notes-cli [<options>] <since>..<until> <template>")
.demandCommand(1)
.example('release-notes-cli -t "(feat|bug): (.*)" -m type -m title v1.0.0..v2.0.0 appstore/markdown/html', "Match all commits with starting with either `feat:` or `bug` between the tags `v1.0.0` and `v2.0.0`")
.wrap(null)
.option("f", {
alias: "file",
describe: "Configuration file. Use it instead of passing command line options",
})
.option("p", {
alias: "path",
describe: "Git project path. Defaults to the current path",
default: process.cwd(),
})
.option("t", {
alias: "title",
describe: "Commit title regular expression",
default: "(.*)",
})
.option("i", {
alias: "ignore-case",
describe: "Ignore case of title's regular expression",
type: "boolean",
})
.option("m", {
alias: "meaning",
describe: "Meaning of capturing block in title's regular expression",
default: ["type"],
})
.option("b", {
alias: "branch",
describe: "Git branch, defaults to master",
default: "master",
type: "string",
})
.option("s", {
alias: "script",
describe: "External script to rewrite the commit history",
})
.option("o", {
alias: "gitlog-option",
describe: "Additional git log options AND ignore 'c' option",
default: [],
})
.option("mg", {
alias: "merge-commits",
describe: "Only use merge commits",
type: "boolean",
})
.option("c", {
alias: "copy",
describe: "for copy log into clipboard",
default: false,
type: "boolean",
}).argv;
(0, index_1.default)(argv, argv._[0], argv._[1])
.then((output) => { })
.catch((error) => {
require("yargs").showHelp();
console.log(chalk.red(error.message));
process.exit(1);
});
});
}
exports.run = run;