関数いろいろ追加

This commit is contained in:
ろむねこ 2024-06-17 11:48:11 +09:00
parent 01d4574c93
commit 91b14bcc14
Signed by: Fujimatsu
GPG Key ID: FA1F39A1BA37D168

View File

@ -33,4 +33,15 @@ function getCommitDate() {
}); });
} }
export { getCommitHash, getCommitMessage, getCommitDate } function getBranchName() {
return new Promise((resolve) => {
exec('git rev-parse --abbrev-ref HEAD', (err, stdout) => {
if (err) {
resolve('Something went wrong');
}
resolve(stdout.trim());
});
});
}
export { getCommitHash, getCommitMessage, getCommitDate, getBranchName }