Add console logging to update
This commit is contained in:
parent
849ea4770b
commit
6f0d157961
1 changed files with 3 additions and 0 deletions
|
@ -85,8 +85,10 @@ class BotutilCog(Scale):
|
||||||
remote_hash = origin.refs[repo.active_branch.name].object.hexsha
|
remote_hash = origin.refs[repo.active_branch.name].object.hexsha
|
||||||
|
|
||||||
if current_hash != remote_hash:
|
if current_hash != remote_hash:
|
||||||
|
self.logger.info("Updating...")
|
||||||
current_commands = get_all_commands()
|
current_commands = get_all_commands()
|
||||||
origin.pull()
|
origin.pull()
|
||||||
|
self.logger.info("Changes pulled...")
|
||||||
await asyncio.sleep(3)
|
await asyncio.sleep(3)
|
||||||
new_commands = get_all_commands()
|
new_commands = get_all_commands()
|
||||||
for module, commands in new_commands:
|
for module, commands in new_commands:
|
||||||
|
@ -109,6 +111,7 @@ class BotutilCog(Scale):
|
||||||
self.bot.reload_extension(module)
|
self.bot.reload_extension(module)
|
||||||
elif any(new_args[x] != y for x, y in old_args):
|
elif any(new_args[x] != y for x, y in old_args):
|
||||||
self.bot.reload_extension(module)
|
self.bot.reload_extension(module)
|
||||||
|
self.logger.info("Updates applied")
|
||||||
await ctx.reply(f"Updates applied! `{current_hash}` => `{remote_hash}`")
|
await ctx.reply(f"Updates applied! `{current_hash}` => `{remote_hash}`")
|
||||||
else:
|
else:
|
||||||
await ctx.reply(f"No updates to apply. `{current_hash}` == `{remote_hash}`")
|
await ctx.reply(f"No updates to apply. `{current_hash}` == `{remote_hash}`")
|
||||||
|
|
Loading…
Add table
Reference in a new issue