From 802b97b2edb142ad6bc4ee10ccc16ece7c6dc346 Mon Sep 17 00:00:00 2001 From: mo8it Date: Thu, 1 Aug 2024 01:07:31 +0200 Subject: [PATCH] Set stdin to null when running the binary of an exercise --- src/cmd.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cmd.rs b/src/cmd.rs index efeb5988..d158bfb9 100644 --- a/src/cmd.rs +++ b/src/cmd.rs @@ -10,7 +10,8 @@ use std::{ pub fn run_cmd(mut cmd: Command, description: &str, output: Option<&mut Vec>) -> Result { let spawn = |mut cmd: Command| { // NOTE: The closure drops `cmd` which prevents a pipe deadlock. - cmd.spawn() + cmd.stdin(Stdio::null()) + .spawn() .with_context(|| format!("Failed to run the command `{description}`")) };