File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 88import { existsSync , walkSync } from "fs/mod.ts" ;
99import { dirname , join } from "path/mod.ts" ;
1010import { warnOnce } from "./log.ts" ;
11- import { which } from "./path.ts" ;
11+ import { safeExistsSync , which } from "./path.ts" ;
1212import { quartoConfig } from "./quarto.ts" ;
1313import {
1414 kHKeyCurrentUser ,
@@ -63,7 +63,13 @@ export async function rBinaryPath(binary: string): Promise<string> {
6363 // if there is an R_HOME then respect that
6464 const rHome = Deno . env . get ( "R_HOME" ) ;
6565 if ( rHome ) {
66- return join ( rHome , "bin" , binary ) ;
66+ let rHomeBin = join ( rHome , "bin" , binary ) ;
67+ if ( safeExistsSync ( rHomeBin ) ) return rHomeBin ;
68+ if ( Deno . build . os === "windows" ) {
69+ // Some installation have binaries in the sub folder only
70+ rHomeBin = join ( rHome , "bin" , "x64" , binary ) ;
71+ if ( safeExistsSync ( rHomeBin ) ) return rHomeBin ;
72+ }
6773 }
6874
6975 // then check the path
You can’t perform that action at this time.
0 commit comments