diff --git a/commands/admin/update.js b/commands/admin/update.js index 797944a..7c9a75f 100644 --- a/commands/admin/update.js +++ b/commands/admin/update.js @@ -32,7 +32,8 @@ module.exports = { sendText = `${sendText}\n... Message is too long to show everything` } message.channel.send(sendText) - client.githash = executeCommand(`git`, ["rev-parse", "--short", "HEAD"]) + const githash = executeCommand(`git`, ["rev-parse", "--short", "HEAD"]); + client.githash = githash.error ? "N/A" : githash.output; if (err) console.log(stderr) }) } diff --git a/server.js b/server.js index c8f5d8b..30ed3a3 100644 --- a/server.js +++ b/server.js @@ -56,7 +56,9 @@ createAndLoadWhitelistTable(client.whitelist); client.settings.set("presenceType", presenceType); client.settings.set("presenceText", presenceText); client.settings.set("globalPrefix", globalPrefix); -client.githash = executeCommand(`git`, ["rev-parse", "--short", "HEAD"]) + +const githash = executeCommand(`git`, ["rev-parse", "--short", "HEAD"]); +client.githash = githash.error ? "N/A" : githash.output; const reloadCommands = require("./util/reloadCommands.js"); const onMessage = require('./server/message');