Skip to content

Commit e4f6805

Browse files
committed
fix(cargo-php): get_ext_dir()/get_php_ini(): stdout noise tolerance
1 parent 660f308 commit e4f6805

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/cli/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ fn get_ext_dir() -> AResult<PathBuf> {
253253
bail!("Failed to call PHP: {:?}", cmd);
254254
}
255255
let stdout = String::from_utf8_lossy(&cmd.stdout);
256-
let ext_dir = PathBuf::from(&*stdout);
256+
let ext_dir = PathBuf::from(stdout.rsplit("\n").next().unwrap());
257257
if !ext_dir.is_dir() {
258258
if ext_dir.exists() {
259259
bail!(
@@ -283,7 +283,7 @@ fn get_php_ini() -> AResult<PathBuf> {
283283
bail!("Failed to call PHP: {:?}", cmd);
284284
}
285285
let stdout = String::from_utf8_lossy(&cmd.stdout);
286-
let ini = PathBuf::from(&*stdout);
286+
let ini = PathBuf::from(stdout.rsplit("\n").next().unwrap());
287287
if !ini.is_file() {
288288
bail!(
289289
"php.ini does not exist or is not a file at the given path: {:?}",

0 commit comments

Comments
 (0)