git-release-manager
Version:
A tool to generate release notes from git commit history
27 lines • 968 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getGitLogAsJson = getGitLogAsJson;
const simple_git_1 = __importDefault(require("simple-git"));
async function getGitLogAsJson(range = null) {
const git = (0, simple_git_1.default)();
try {
const log = range ? await git.log([range]) : await git.log();
return log.all.map(commit => ({
hash: commit.hash,
shortHash: commit.hash.substring(0, 7),
message: commit.message,
body: commit.body,
authorName: commit.author_name,
authorEmail: commit.author_email,
date: commit.date,
}));
}
catch (error) {
console.error('Error fetching git log:', error);
return [];
}
}
//# sourceMappingURL=gitLogFetcher.js.map