Skip to content

Commit

Permalink
Get version from package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
danallison committed Nov 3, 2017
1 parent 78b626c commit 5089efd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div id="main-container" class="theme-light">
<header id="header">
<img id="logo" src="assets/images/logo-blue-black.svg">
<span id="version">v0.3.0</span>
<span id="version"></span>
<div class="header-right">
<span id="save-status">saved</span>
</div>
Expand Down Expand Up @@ -39,6 +39,13 @@
</script>
<script src="assets/application.js" type="text/javascript"></script>
<script>if (window.module) module = window.module;</script>
<script>
(function () {
var fs = require('fs');
var version = JSON.parse(fs.readFileSync('package.json')).version;
document.getElementById('version').textContent = 'v' + version;
})();
</script>
</body>

</html>

0 comments on commit 5089efd

Please # to comment.