Skip to content

Commit 0b6a9c5

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

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

build.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ 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+
.replace('\r', "")
66+
.lines()
67+
.next()
68+
.map(|l| l.trim().into())
6469
} else {
6570
None
6671
}

0 commit comments

Comments
 (0)