Skip to content

Commit 3dd870a

Browse files
authored
fix(cargo-php): get_ext_dir()/get_php_ini() stdout noise tolerance
Refs: #459
1 parent c867a2a commit 3dd870a

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
@@ -272,7 +272,7 @@ fn get_ext_dir() -> AResult<PathBuf> {
272272
bail!("Failed to call PHP: {:?}", cmd);
273273
}
274274
let stdout = String::from_utf8_lossy(&cmd.stdout);
275-
let ext_dir = PathBuf::from(&*stdout);
275+
let ext_dir = PathBuf::from(stdout.rsplit('\n').next().unwrap());
276276
if !ext_dir.is_dir() {
277277
if ext_dir.exists() {
278278
bail!(
@@ -302,7 +302,7 @@ fn get_php_ini() -> AResult<PathBuf> {
302302
bail!("Failed to call PHP: {:?}", cmd);
303303
}
304304
let stdout = String::from_utf8_lossy(&cmd.stdout);
305-
let ini = PathBuf::from(&*stdout);
305+
let ini = PathBuf::from(stdout.rsplit('\n').next().unwrap());
306306
if !ini.is_file() {
307307
bail!(
308308
"php.ini does not exist or is not a file at the given path: {:?}",

0 commit comments

Comments
 (0)