diff options
| author | 2020-02-08 13:15:39 +0000 | |
|---|---|---|
| committer | 2020-02-08 13:21:29 +0000 | |
| commit | 4e9df2c552b9ea6212e223e38c8f5d49be3e6d42 (patch) | |
| tree | 983f01126785e7166e27d2c59e02ad5b8841219d /modules/info.py | |
| parent | spec[2] is a string, not an array of strings (diff) | |
| signature | ||
handle git being in a detached head state when getting current commit
Diffstat (limited to 'modules/info.py')
| -rw-r--r-- | modules/info.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/info.py b/modules/info.py index 8b9ad9e6..db23d068 100644 --- a/modules/info.py +++ b/modules/info.py @@ -4,11 +4,12 @@ from src import IRCBot, ModuleManager, utils class Module(ModuleManager.BaseModule): @utils.hook("received.command.version") def version(self, event): - commit_hash = utils.git_commit(self.bot.directory) + commit = utils.git_commit(self.bot.directory) out = "Version: BitBot %s" % IRCBot.VERSION - if not commit_hash == None: - out = "%s (%s@%s)" % (out, branch, commit_hash) + if not commit == None: + branch, commit = commit + out = "%s (%s@%s)" % (out, branch or "", commit) event["stdout"].write(out) @utils.hook("received.command.source") |
