-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Benedith Mulongo
committed
Jul 5, 2024
1 parent
3f17306
commit a6872e3
Showing
2 changed files
with
41 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
require('dotenv').config(); | ||
const fs = require('fs'); | ||
const { version } = require('os'); | ||
const exec = require('child_process').exec; | ||
require("dotenv").config(); | ||
const fs = require("fs"); | ||
const { version } = require("os"); | ||
const exec = require("child_process").exec; | ||
const latestCommit = null; | ||
|
||
exec('git rev-parse --verify HEAD', (err, stdout, stderr) => { | ||
// git log -n 1 --pretty=format:"%H" | ||
if (err) { | ||
console.error(`error: ${err}`); | ||
return; | ||
} | ||
|
||
if (stderr) { | ||
console.error(`stderr: ${stderr}`); | ||
return; | ||
} | ||
console.log(`stdout: ${stdout}`); | ||
this.latestCommit = stdout; | ||
var data = `var data = {"version": "${stdout}"};\nexport {data}` | ||
fs.writeFileSync('dist/version.js', data); | ||
}) | ||
exec("git rev-parse --verify HEAD", (err, stdout, stderr) => { | ||
// git log -n 1 --pretty=format:"%H" | ||
if (err) { | ||
console.error(`error: ${err}`); | ||
return; | ||
} | ||
|
||
if (stderr) { | ||
console.error(`stderr: ${stderr}`); | ||
return; | ||
} | ||
console.log(`stdout: ${stdout}`); | ||
this.latestCommit = stdout; | ||
var data = `var data = {"version": "${stdout}"};\nexport {data}`; | ||
fs.writeFileSync("dist/version.js", data); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters