From 6e83b17b2d140e422b7d2e6cccc06a174eb01fec Mon Sep 17 00:00:00 2001 From: Aetherinox Date: Sat, 31 May 2025 03:25:22 -0700 Subject: [PATCH] feat: interface footer now shows github commit hash --- tvapp2/index.js | 8 ++++++-- tvapp2/www/index.html | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tvapp2/index.js b/tvapp2/index.js index 8e98348b..ed331ce5 100755 --- a/tvapp2/index.js +++ b/tvapp2/index.js @@ -12,6 +12,7 @@ import zlib from 'zlib'; import chalk from 'chalk'; import ejs from 'ejs'; import moment from 'moment'; +import * as child from 'child_process'; import cron, { schedule } from 'node-cron'; import * as crons from 'cron'; @@ -29,6 +30,7 @@ const cache = new Map(); const { name, author, version, repository, discord, docs } = JSON.parse( fs.readFileSync( './package.json' ) ); const __filename = fileURLToPath( import.meta.url ); // get resolved path to file const __dirname = path.dirname( __filename ); // get name of directory +const gitHash = child.execSync( 'git rev-parse HEAD' ).toString().trim(); /* chalk.level @@ -2192,9 +2194,11 @@ const server = http.createServer( ( request, response ) => appRelease: envAppRelease, appName: name, appVersion: version, - appUrlGithub: repository.url, + appUrlGithub: repository.url.substr( 0, repository.url.lastIndexOf( '.' ) ), appUrlDiscord: discord.url, - appUrlDocs: docs.url + appUrlDocs: docs.url, + appGitHashShort: gitHash.substring( 0, 9 ), + appGitHashLong: gitHash }, ( err, data ) => { if ( !err ) diff --git a/tvapp2/www/index.html b/tvapp2/www/index.html index 050eaec8..2949017f 100644 --- a/tvapp2/www/index.html +++ b/tvapp2/www/index.html @@ -124,7 +124,7 @@