From 502bf5da95c507fc63b35b881bd1ef5695c2179d Mon Sep 17 00:00:00 2001 From: Vasily Zorin Date: Fri, 27 Jun 2025 17:16:52 +0700 Subject: [PATCH] fix(cargo-php): get_ext_dir()/get_php_ini(): stdout noise tolerance --- crates/cli/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/cli/src/lib.rs b/crates/cli/src/lib.rs index 8ea76a499..ca71d62e6 100644 --- a/crates/cli/src/lib.rs +++ b/crates/cli/src/lib.rs @@ -272,7 +272,7 @@ fn get_ext_dir() -> AResult { bail!("Failed to call PHP: {:?}", cmd); } let stdout = String::from_utf8_lossy(&cmd.stdout); - let ext_dir = PathBuf::from(&*stdout); + let ext_dir = PathBuf::from(stdout.rsplit('\n').next().unwrap()); if !ext_dir.is_dir() { if ext_dir.exists() { bail!( @@ -302,7 +302,7 @@ fn get_php_ini() -> AResult { bail!("Failed to call PHP: {:?}", cmd); } let stdout = String::from_utf8_lossy(&cmd.stdout); - let ini = PathBuf::from(&*stdout); + let ini = PathBuf::from(stdout.rsplit('\n').next().unwrap()); if !ini.is_file() { bail!( "php.ini does not exist or is not a file at the given path: {:?}",