Refactor regex

Now it doesn't rely on commit hash being 7 chars
This commit is contained in:
SileNce5k 2021-07-12 18:22:53 +02:00
parent fe8b2d23ea
commit 31fcb4618d
No known key found for this signature in database
GPG key ID: C507260E7F2583AD

View file

@ -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) =>{