From 7db6175904b516579d0acfd95f2876343d8433dc Mon Sep 17 00:00:00 2001 From: Ronan Date: Wed, 16 Oct 2024 17:58:40 +0200 Subject: [PATCH] Show version number and date in console log --- src/aipane/components/App.tsx | 4 +++- src/version.json | 3 ++- webpack.config.js | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/aipane/components/App.tsx b/src/aipane/components/App.tsx index 13ec065..50ebf4f 100644 --- a/src/aipane/components/App.tsx +++ b/src/aipane/components/App.tsx @@ -176,7 +176,9 @@ const App: React.FC = (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 (
diff --git a/src/version.json b/src/version.json index a9c8865..0cb78b1 100644 --- a/src/version.json +++ b/src/version.json @@ -1,3 +1,4 @@ { - "commit": "faa92ccbe26370d1cad683eab13d2b7fb356dde7" + "commit": "d9bcaa0c9cab97b238e4179891ee5a5567007dda", + "date": "2024-10-16 17:45:35 +0200" } \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index b13e30b..2c958c6 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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)); }