From 7b8bca33e6b2637c97b7f835849899f4be11a3f0 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Fri, 24 May 2024 22:00:27 +0200 Subject: [PATCH] run command and print --- backend/src/sandbox.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/src/sandbox.rs b/backend/src/sandbox.rs index 2cbb176..d6e6348 100644 --- a/backend/src/sandbox.rs +++ b/backend/src/sandbox.rs @@ -128,4 +128,11 @@ pub fn run_code(code: &str) { let cmd_args = command("/app/main.ha"); bwrap_cmd.args(cmd_args); + + let output = bwrap_cmd.output().expect("running bwrap failed"); + let stdout = String::from_utf8_lossy(&output.stdout); + let stderr = String::from_utf8_lossy(&output.stderr); + + println!("stdout:\n{stdout}"); + println!("stderr:\n{stderr}"); }