git-release-manager
Version:
A tool to generate release notes from git commit history
18 lines • 828 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBranchesAsync = getBranchesAsync;
const cmd_1 = require("../../../utils/cmd");
async function getBranchesAsync() {
const [{ stdout: current }, { stdout: merged }, { stdout: unmerged }] = await Promise.all([
(0, cmd_1.execWithErrorHandling)('git branch --show-current'),
(0, cmd_1.execWithErrorHandling)('git branch --merged'),
(0, cmd_1.execWithErrorHandling)('git branch --no-merged'),
]);
return {
current: current.trim(),
merged: cleanList(merged),
unmerged: cleanList(unmerged),
};
}
const cleanList = (output) => (output === null || output === void 0 ? void 0 : output.split('\n').map(line => line.trim()).filter(Boolean)) || [];
//# sourceMappingURL=branchHandler.js.map