From 31fcb4618da27af8506f09a6883542389d41f7c4 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Mon, 12 Jul 2021 18:22:53 +0200 Subject: [PATCH] Refactor regex Now it doesn't rely on commit hash being 7 chars --- commands/update.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/update.js b/commands/update.js index 7b6a2e6..6f2f450 100644 --- a/commands/update.js +++ b/commands/update.js @@ -20,7 +20,7 @@ module.exports = { sendText = sendText + "\nServer.js OR message.js OR ready.js has been updated.\nThis requires the bot to be restarted." } message.channel.send(sendText).then(function(msg){ - let regex = /(.{0,7}\.\..{0,7})/ + let regex = /([^\s]+)\.\.([^\s]+)/ let commits = stdout.match(regex)[0] cmd = `git log --oneline ${commits}`; exec(cmd, (err, stdout, stderr) =>{