at master 41 lines 1.7 kB view raw
1diff --git a/src/cpp/core/r_util/REnvironmentPosix.cpp b/src/cpp/core/r_util/REnvironmentPosix.cpp 2index a4e964d49d..512707801b 100644 3--- a/src/cpp/core/r_util/REnvironmentPosix.cpp 4+++ b/src/cpp/core/r_util/REnvironmentPosix.cpp 5@@ -108,13 +108,7 @@ FilePath systemDefaultRScript(std::string* pErrMsg) 6 { 7 // check fallback paths 8 std::vector<std::string> rScriptPaths = { 9- "/usr/bin/R", 10- "/usr/local/bin/R", 11- "/opt/local/bin/R", 12- #ifdef __APPLE__ 13- "/opt/homebrew/bin/R", 14- "/Library/Frameworks/R.framework/Resources/bin/R", 15- #endif 16+ "@R@/bin/R" 17 }; 18 19 return scanForRScript(rScriptPaths, pErrMsg); 20@@ -226,8 +220,7 @@ FilePath systemDefaultRScript(std::string* pErrMsg) 21 // scan in standard locations as a fallback 22 std::string scanErrMsg; 23 std::vector<std::string> rScriptPaths; 24- rScriptPaths.push_back("/usr/local/bin/R"); 25- rScriptPaths.push_back("/usr/bin/R"); 26+ rScriptPaths.push_back("@R@/bin/R"); 27 FilePath scriptPath = scanForRScript(rScriptPaths, &scanErrMsg); 28 if (scriptPath.isEmpty()) 29 { 30diff --git a/src/node/desktop/src/main/detect-r.ts b/src/node/desktop/src/main/detect-r.ts 31index 5b768b7cbf..c0efeac0fe 100644 32--- a/src/node/desktop/src/main/detect-r.ts 33+++ b/src/node/desktop/src/main/detect-r.ts 34@@ -305,6 +305,7 @@ writeLines(sep = "\x1F", c( 35 } 36 37 export function scanForR(): Expected<string> { 38+ return ok('@R@/bin/R'); 39 // if the RSTUDIO_WHICH_R environment variable is set, use that 40 // note that this does not pick up variables set in a user's bash profile, for example 41 const rstudioWhichR = getenv('RSTUDIO_WHICH_R');