From e3f2b1100743a3b07fe3c3545416d56ee8bcde16 Mon Sep 17 00:00:00 2001 From: Leander Furumo Date: Sat, 24 Oct 2026 04:31:30 +0200 Subject: [PATCH] wait for git pull to finish and display results --- src/cogs/dev_tools.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/cogs/dev_tools.py b/src/cogs/dev_tools.py index 27f76fd..d7c597e 100644 --- a/src/cogs/dev_tools.py +++ b/src/cogs/dev_tools.py @@ -33,8 +33,17 @@ class DevTools(commands.Cog): ctx (commands.Context): Context object """ - await asyncio.create_subprocess_shell("git pull") - await ctx.reply("Done!") + process = await asyncio.create_subprocess_exec( + "git", "pull", stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.STDOUT + ) + stdout, _ = await process.communicate() + output = stdout.decode(errors="replace").strip() or "Ingen output" + + if process.returncode == 0: + embed = embed_templates.success(f"```\n{output[:4000]}\n```") + else: + embed = embed_templates.error_fatal(f"git pull feilet ({process.returncode})\n```\n{output[:3950]}\n```") + await ctx.reply(embed=embed) @commands.is_owner() @commands.bot_has_permissions(embed_links=True)