mirror of
https://github.com/IvarK/AntimatterDimensionsSourceCode.git
synced 2024-11-22 04:05:42 +00:00
18 lines
473 B
JavaScript
18 lines
473 B
JavaScript
const fs = require("fs");
|
|
const path = require("path");
|
|
const proc = require("child_process");
|
|
|
|
function executeCommand(command) {
|
|
return proc.execSync(command).toString().trim();
|
|
}
|
|
|
|
const commit = {
|
|
sha: executeCommand("git rev-parse HEAD"),
|
|
message: executeCommand("git log -1 --pretty=%B"),
|
|
author: executeCommand("git log -1 --pretty=format:%an")
|
|
};
|
|
|
|
const json = JSON.stringify(commit);
|
|
|
|
fs.writeFileSync(path.resolve(__dirname, "../dist/commit.json"), json);
|