From 3e7bf81def17ccb0c97d08555ac44cc254736874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20N=C3=B8rby=20Andersen?= Date: Wed, 28 Dec 2022 23:54:05 +0100 Subject: [PATCH 1/2] add generateVersion script and include in deployment --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4254716..6679dd5 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "start": "parcel", "build": "yarn clean && parcel build --public-url ./", "clean": "rm -rf dist/", - "deploy": "yarn build && gh-pages -d dist" + "deploy": "yarn generateVersion && yarn build && gh-pages -d dist", + "generateVersion": "git rev-parse --short HEAD > assets/VERSION.txt" }, "devDependencies": { "autoprefixer": "^10.4.2", @@ -24,4 +25,4 @@ "wavefile": "^11.0.0", "wavesurfer.js": "^6.2.0" } -} +} \ No newline at end of file From b5e3d3edb09892341ff683e2751c865f9a8f5626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20N=C3=B8rby=20Andersen?= Date: Wed, 28 Dec 2022 23:54:45 +0100 Subject: [PATCH 2/2] grab git hash from VERSION.txt and put in site footer --- src/index.html | 2 ++ src/index.js | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 10ee441..76bfdb5 100644 --- a/src/index.html +++ b/src/index.html @@ -56,6 +56,8 @@

SHORTCUTS

diff --git a/src/index.js b/src/index.js index 2ddf60c..08c8596 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,7 @@ import Morphaweb from './Morphaweb' +import version from 'bundle-text:../assets/VERSION.txt' -const morphaweb = new Morphaweb() \ No newline at end of file +const morphaweb = new Morphaweb() + +const versionElement = document.getElementById('version') +versionElement.textContent = version \ No newline at end of file