Skip to content

Commit 895cb93

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

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+
.split("\n")
67+
.next()
68+
.map(Into::into)
6469
} else {
6570
None
6671
}

0 commit comments

Comments
 (0)