forked from NextCommunity/NextCommunity.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
25 lines (21 loc) · 643 Bytes
/
build.js
File metadata and controls
25 lines (21 loc) · 643 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const { execSync } = require("node:child_process");
module.exports = () => {
const now = new Date();
// Format the date: "Jan 26, 2026, 07:51 AM"
const timestamp = now.toLocaleString("en-US", {
dateStyle: "medium",
timeStyle: "short",
});
let gitHash = "development";
try {
// Get the short git hash (first 7 characters)
gitHash = execSync("git rev-parse --short HEAD").toString().trim();
} catch (_e) {
console.warn("Could not fetch git hash, defaulting to 'development'");
}
return {
timestamp,
hash: gitHash,
repoUrl: "https://github.com/NextCommunity/NextCommunity.github.io",
};
};