Skip to content

Commit

Permalink
Merge branch 'v2-branch' of https://github.com/r-lib/actions into v2-…
Browse files Browse the repository at this point in the history
…branch
  • Loading branch information
gaborcsardi committed Jan 24, 2024
2 parents 65fed2e + e0c79f8 commit 46e9e5f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
11 changes: 9 additions & 2 deletions setup-r/lib/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,16 +387,23 @@ function acquireRMacOS(version) {
core.debug(`${error}`);
throw `Failed to install R: ${error}`;
}
// Remove homebrew R from the PATH
try {
yield exec.exec("brew", ["unlink", "r"]);
}
catch (error) {
core.debug(`${error}`);
}
// Older R versions on newer macOS cannot create a symlink to R and
// Rscript, we'll need to do it manually.
try {
yield exec.exec("sudo ln", [
"-sf",
"-sfv",
"/Library/Frameworks/R.framework/Resources/bin/R",
"/usr/local/bin/R"
]);
yield exec.exec("sudo ln", [
"-sf",
"-sfv",
"/Library/Frameworks/R.framework/Resources/bin/Rscript",
"/usr/local/bin/Rscript"
]);
Expand Down
11 changes: 9 additions & 2 deletions setup-r/src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,16 +370,23 @@ async function acquireRMacOS(version: IRVersion): Promise<string> {
throw `Failed to install R: ${error}`;
}

// Remove homebrew R from the PATH
try {
await exec.exec("brew", ["unlink", "r"]);
} catch (error) {
core.debug(`${error}`);
}

// Older R versions on newer macOS cannot create a symlink to R and
// Rscript, we'll need to do it manually.
try {
await exec.exec("sudo ln", [
"-sf",
"-sfv",
"/Library/Frameworks/R.framework/Resources/bin/R",
"/usr/local/bin/R"
]);
await exec.exec("sudo ln", [
"-sf",
"-sfv",
"/Library/Frameworks/R.framework/Resources/bin/Rscript",
"/usr/local/bin/Rscript"
]);
Expand Down

0 comments on commit 46e9e5f

Please sign in to comment.