From 1b55e1b69a64bc12784579d89c84333f0a83d1b0 Mon Sep 17 00:00:00 2001 From: Lucas Gabriel <90426410+lucmsilva651@users.noreply.github.com> Date: Sun, 8 Sep 2024 00:18:42 -0300 Subject: [PATCH] Update crew.js --- commands/crew.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/commands/crew.js b/commands/crew.js index 2a780d5..257f09c 100644 --- a/commands/crew.js +++ b/commands/crew.js @@ -4,6 +4,18 @@ const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); const os = require('os'); +function getGitCommitHash() { + return new Promise((resolve, reject) => { + exec('git rev-parse --short HEAD', (error, stdout, stderr) => { + if (error) { + reject(`Error: ${stderr}`); + } else { + resolve(stdout.trim()); + } + }); + }); +} + function formatUptime(uptime) { const hours = Math.floor(uptime / 3600); const minutes = Math.floor((uptime % 3600) / 60);