From 60f5f8fa1c821ca9565c65ffb622715dd23bc030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20P=C3=B6hn?= Date: Wed, 8 Oct 2025 17:21:53 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=8A=20add=20vagrant=20support=20to=20e?= =?UTF-8?q?xec=20subcommand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fdroidserver/common.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 627d4cf5..97bbaedc 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -5183,6 +5183,23 @@ def get_vagrantfile_path(appid, vercode): def vagrant_exec(appid, vercode, command): """Execute a command in the Vagrant VM via ssh.""" + vagrantfile = get_vagrantfile_path(appid, vercode) + to_stdin = shlex.join(command) + p = subprocess.run( + [ + 'vagrant', + 'ssh', + '-c', + 'bash', + ], + input=to_stdin, + text=True, + cwd=vagrantfile.parent, + ) + if p.returncode != 0: + raise subprocess.CalledProcessError( + p.returncode, f"{to_stdin} | {' '.join(p.args)}" + ) def vagrant_destroy(appid, vercode):