git-release-manager
Version:
A tool to generate release notes from git commit history
29 lines • 1.31 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCommitsAsync = getCommitsAsync;
const cmd_1 = require("../../../utils/cmd");
async function getCommitsAsync() {
const [{ stdout: hash }, { stdout: shortHash }, { stdout: message }, { stdout: body }, { stdout: authorName }, { stdout: authorEmail }, { stdout: date }, { stdout: count }] = await Promise.all([
(0, cmd_1.execWithErrorHandling)("git log -1 --pretty=format:'%H'"),
(0, cmd_1.execWithErrorHandling)("git log -1 --pretty=format:'%h'"),
(0, cmd_1.execWithErrorHandling)("git log -1 --pretty=format:'%s'"),
(0, cmd_1.execWithErrorHandling)("git log -1 --pretty=format:'%b'"),
(0, cmd_1.execWithErrorHandling)('git log -1 --pretty=format:"%an"'),
(0, cmd_1.execWithErrorHandling)('git log -1 --pretty=format:"%ae"'),
(0, cmd_1.execWithErrorHandling)("git log -1 --pretty=format:'%ad'"),
(0, cmd_1.execWithErrorHandling)('git rev-list --count HEAD'),
]);
return {
latest: {
hash,
shortHash,
message,
body,
authorName,
authorEmail,
date,
},
count: parseInt(count.trim(), 10) || 0,
};
}
//# sourceMappingURL=commitHandler.js.map