cobalt/modules/sub/current-commit.js

8 lines
303 B
JavaScript
Raw Normal View History

2022-07-08 19:17:56 +01:00
import { execSync } from "child_process";
export function shortCommit() {
2022-07-08 19:17:56 +01:00
return execSync('git rev-parse --short HEAD').toString().trim()
}
export function getCommitInfo() {
return execSync(`git show -s --format='%s;;;%B'`).toString().trim().slice(1,-1).replace(/[\r\n]/gm, '\n').split(';;;')
2022-07-08 19:17:56 +01:00
}