Spaces:
Build error
Build error
Create pre-start.cjs
Browse files- pre-start.cjs +26 -0
pre-start.cjs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const { execSync } = require('child_process');
|
| 2 |
+
|
| 3 |
+
// Get git hash with fallback
|
| 4 |
+
const getGitHash = () => {
|
| 5 |
+
try {
|
| 6 |
+
return execSync('git rev-parse --short HEAD').toString().trim();
|
| 7 |
+
} catch {
|
| 8 |
+
return 'no-git-info';
|
| 9 |
+
}
|
| 10 |
+
};
|
| 11 |
+
|
| 12 |
+
let commitJson = {
|
| 13 |
+
hash: JSON.stringify(getGitHash()),
|
| 14 |
+
version: JSON.stringify(process.env.npm_package_version),
|
| 15 |
+
};
|
| 16 |
+
|
| 17 |
+
console.log(`
|
| 18 |
+
★═══════════════════════════════════════★
|
| 19 |
+
B O L T . D I Y
|
| 20 |
+
⚡️ Welcome ⚡️
|
| 21 |
+
★═══════════════════════════════════════★
|
| 22 |
+
`);
|
| 23 |
+
console.log('📍 Current Version Tag:', `v${commitJson.version}`);
|
| 24 |
+
console.log('📍 Current Commit Version:', commitJson.hash);
|
| 25 |
+
console.log(' Please wait until the URL appears here');
|
| 26 |
+
console.log('★═══════════════════════════════════════★');
|