From 878722c91dc3be0761340fcfe38d5c9c1ff81901 Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Tue, 26 Sep 2023 21:14:13 +1000 Subject: [PATCH] Add timestamp next to hashes --- src/commands/statistics.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/commands/statistics.ts b/src/commands/statistics.ts index 31593fc..3c264b3 100644 --- a/src/commands/statistics.ts +++ b/src/commands/statistics.ts @@ -15,6 +15,11 @@ function commitHashes() { const remoteHash = execSync('git ls-remote origin HEAD').toString().split('\t')[0].slice(0, 7); return { localHash, remoteHash }; } +function commitTimestamp() { + const localTimestamp = execSync('git log -1 --format=%ct').toString().trimEnd(); + const remoteTimestamp = execSync('git show -s --format=%ct').toString().trimEnd(); + return { localTimestamp, remoteTimestamp }; +} export default { async run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){ @@ -53,8 +58,8 @@ export default { embed.addFields( { name: '> __Repository__', value: MessageTool.concatMessage( - `**Local:** ${commitHashes().localHash}`, - `**Remote:** ${commitHashes().remoteHash}` + `**Local:** ${commitHashes().localHash} `, + `**Remote:** ${commitHashes().remoteHash} ` ) }, {name: '> __Dependencies__', value: MessageTool.concatMessage(