diff --git a/compile.js b/compile.js index e72e665..a05017d 100644 --- a/compile.js +++ b/compile.js @@ -2,12 +2,17 @@ const { parse } = require('@ltd/j-toml'); const { render } = require('mustache'); const { readFile, writeFile } = require('node:fs/promises'); const { resolve } = require('node:path'); +const util = require('node:util'); +const exec = util.promisify(require('node:child_process').exec); async function compile() { + const { stdout, stderr } = await exec('git rev-parse --short @'); + const confPath = resolve('./config.toml'); const confToml = await readFile(confPath, { encoding: 'utf8' }); const config = parse(confToml); + config.version = stdout.trim(); config.text = function () { const string = this.icon; return string.charAt(0).toUpperCase() + string.slice(1); diff --git a/index.html b/index.html index 5f8b9c2..b7d8568 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ {{title}} - +