Skip to content

Commit 964620d

Browse files
committed
[windows] R is now found if several binaries in PATH
This solves issue with some R intallation where several R version are on PATH but not in registry, e.g egde case with scoop. WHERE command on CMD will return full path to each file found, and not only one command like which on UNIX
1 parent 78ad457 commit 964620d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/path.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ export async function which(cmd: string) {
9595
{ cmd: args, stderr: "piped", stdout: "piped" },
9696
);
9797
if (result.code === 0) {
98-
return result.stdout?.trim();
98+
return Deno.build.os === "windows"
99+
// WHERE return all files found, only first is kept
100+
? result.stdout?.split("\n")[0].trim()
101+
: result.stdout?.trim();
99102
} else {
100103
return undefined;
101104
}

0 commit comments

Comments
 (0)