mirror of
https://github.com/TheBinaryNinja/tvapp2.git
synced 2026-06-04 09:15:41 -04:00
feat: interface footer now shows github commit hash
This commit is contained in:
@@ -12,6 +12,7 @@ import zlib from 'zlib';
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import ejs from 'ejs';
|
import ejs from 'ejs';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
import * as child from 'child_process';
|
||||||
import cron, { schedule } from 'node-cron';
|
import cron, { schedule } from 'node-cron';
|
||||||
import * as crons from '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 { name, author, version, repository, discord, docs } = JSON.parse( fs.readFileSync( './package.json' ) );
|
||||||
const __filename = fileURLToPath( import.meta.url ); // get resolved path to file
|
const __filename = fileURLToPath( import.meta.url ); // get resolved path to file
|
||||||
const __dirname = path.dirname( __filename ); // get name of directory
|
const __dirname = path.dirname( __filename ); // get name of directory
|
||||||
|
const gitHash = child.execSync( 'git rev-parse HEAD' ).toString().trim();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
chalk.level
|
chalk.level
|
||||||
@@ -2192,9 +2194,11 @@ const server = http.createServer( ( request, response ) =>
|
|||||||
appRelease: envAppRelease,
|
appRelease: envAppRelease,
|
||||||
appName: name,
|
appName: name,
|
||||||
appVersion: version,
|
appVersion: version,
|
||||||
appUrlGithub: repository.url,
|
appUrlGithub: repository.url.substr( 0, repository.url.lastIndexOf( '.' ) ),
|
||||||
appUrlDiscord: discord.url,
|
appUrlDiscord: discord.url,
|
||||||
appUrlDocs: docs.url
|
appUrlDocs: docs.url,
|
||||||
|
appGitHashShort: gitHash.substring( 0, 9 ),
|
||||||
|
appGitHashLong: gitHash
|
||||||
}, ( err, data ) =>
|
}, ( err, data ) =>
|
||||||
{
|
{
|
||||||
if ( !err )
|
if ( !err )
|
||||||
|
|||||||
@@ -124,7 +124,7 @@
|
|||||||
<div class="footer-inner">
|
<div class="footer-inner">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="col text-center text-muted text-small text-nowrap">
|
<div class="col text-center text-muted text-small text-nowrap">
|
||||||
<small>Developed by BinaryNinja - <a data-bs-toggle="tooltip" title="<%= appRelease %> build" href="<%= appUrlGithub %>"><%= appName %> (<%= appRelease %>)</a> - v<%= appVersion %></small><br />
|
<small>Developed by BinaryNinja - <a data-bs-toggle="tooltip" title="v<%= appVersion %> <%= appRelease %> (<%= appGitHashShort %>)" href="<%= appUrlGithub %>"><%= appName %> (<%= appRelease %>)</a> v<%= appVersion %> <a target="_blank" data-bs-toggle="tooltip" title="View Github commit" href="<%= appUrlGithub %>/commit/<%= appGitHashLong %>"><%= appGitHashShort %></a></small><br />
|
||||||
<small>This utility is for educational purposes only</small>
|
<small>This utility is for educational purposes only</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user