Skip to content
Snippets Groups Projects
Commit 9e8c203e authored by Mick Jordan's avatar Mick Jordan
Browse files

set R_HOME correctly when cd'ed in subdir

parent f2042a0e
No related branches found
No related tags found
No related merge requests found
...@@ -125,9 +125,14 @@ public class REnvVars { ...@@ -125,9 +125,14 @@ public class REnvVars {
// This can be called before initialize, "R RHOME" // This can be called before initialize, "R RHOME"
if (rHomePath == null) { if (rHomePath == null) {
File file = new File(System.getProperty("user.dir")); File file = new File(System.getProperty("user.dir"));
if (file.getName().endsWith("r.test")) { do {
file = file.getParentFile(); File binR = new File(new File(file, "bin"), "R");
} if (binR.exists()) {
break;
} else {
file = file.getParentFile();
}
} while (file != null);
rHomePath = file.getAbsolutePath(); rHomePath = file.getAbsolutePath();
// Check any external setting is consistent // Check any external setting is consistent
String envRHomePath = getEnvVars().get("R_HOME"); String envRHomePath = getEnvVars().get("R_HOME");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment