Skip to content

Commit

Permalink
Show version number and date in console log
Browse files Browse the repository at this point in the history
  • Loading branch information
eltorio committed Oct 16, 2024
1 parent d1c412f commit 7db6175
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/aipane/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ const App: React.FC<AppProps> = (props: AppProps): React.JSX.Element => {
}
};

console.log("Version: ", versionCfg.commit);
// Show the version number in the console
// eslint-disable-next-line no-console
console.log(`Version: ${versionCfg.commit} Date: ${versionCfg.date}`);

return (
<div className={styles.root}>
Expand Down
3 changes: 2 additions & 1 deletion src/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"commit": "faa92ccbe26370d1cad683eab13d2b7fb356dde7"
"commit": "d9bcaa0c9cab97b238e4179891ee5a5567007dda",
"date": "2024-10-16 17:45:35 +0200"
}
3 changes: 2 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const urlProd = "https://outlook.addin.pp.ua/"; // CHANGE THIS TO YOUR PRODUCTIO
async function generateVersionFile() {
const git = simpleGit();
const commit = await git.revparse(["HEAD"]);
const versionInfo = { commit };
const commitDate = await git.show(["-s", "--format=%ci", commit]);
const versionInfo = { commit, date: commitDate.replaceAll("\n", "") };
fs.writeFileSync(path.resolve(".", "src/version.json"), JSON.stringify(versionInfo, null, 2));
}

Expand Down

0 comments on commit 7db6175

Please sign in to comment.