diff --git a/frontend/html/index.html b/frontend/html/index.html index 2b9a233..8936efe 100644 --- a/frontend/html/index.html +++ b/frontend/html/index.html @@ -69,7 +69,7 @@ - + \ No newline at end of file diff --git a/frontend/html/poll.html b/frontend/html/poll.html index d3ff2ae..3daa7cb 100644 --- a/frontend/html/poll.html +++ b/frontend/html/poll.html @@ -69,7 +69,7 @@ - + \ No newline at end of file diff --git a/frontend/html/result.html b/frontend/html/result.html index 328ae42..2c17b18 100644 --- a/frontend/html/result.html +++ b/frontend/html/result.html @@ -57,7 +57,7 @@ - + \ No newline at end of file diff --git a/src/frontend.ts b/src/frontend.ts index d008c5e..0cd07df 100644 --- a/src/frontend.ts +++ b/src/frontend.ts @@ -69,7 +69,18 @@ const defaultReplacements = { } catch (error) { return "0.0.0"; } - })() + })(), + "GIT_URL": ((): string => { + try { + if (process.env.HEROKU_SLUG_COMMIT) { + return `git~${ process.env.HEROKU_SLUG_COMMIT.substring(0, 8) }`; + } + const packageJson = JSON.parse(fs.readFileSync(resolve(__dirname, "../package.json"), "utf8")); + return `v${ packageJson.version }`; + } catch (error) { + return "v0.0.0"; + } + })(), }; class Defaults2RenderTransform extends MinificationTransform { constructor(replacements = {}) {