Skip to content

Commit 48bfae0

Browse files
committed
fix(build): take only the first line of which/where when searching for php executable
1 parent 30fd19f commit 48bfae0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ pub fn find_executable(name: &str) -> Option<PathBuf> {
6060
let cmd = Command::new(WHICH).arg(name).output().ok()?;
6161
if cmd.status.success() {
6262
let stdout = String::from_utf8_lossy(&cmd.stdout);
63-
Some(stdout.trim().into())
63+
stdout
64+
.trim()
65+
.lines()
66+
.next()
67+
.map(|l| l.trim().into())
6468
} else {
6569
None
6670
}

0 commit comments

Comments
 (0)