Skip to content

Commit

Permalink
Need to explicitly check for true values rather than relying on coercion
Browse files Browse the repository at this point in the history
I misremembered how type coercion works with boolean strings in typescript
  • Loading branch information
jimhester committed Jan 13, 2021
1 parent 1efbdeb commit 30e0be0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions setup-r/lib/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function acquireR(version, rtoolsVersion) {
acquireUtilsMacOS(),
acquireRMacOS(version)
]);
if (core.getInput("remove-openmp-macos")) {
if (core.getInput("remove-openmp-macos") === "true") {
yield removeOpenmpFlags();
}
}
Expand Down Expand Up @@ -330,13 +330,13 @@ function acquireRtools(version) {
}
if (rtools4) {
core.addPath(`C:\\rtools40\\usr\\bin`);
if (core.getInput("windows-path-include-mingw")) {
if (core.getInput("windows-path-include-mingw") === "true") {
core.addPath(`C:\\rtools40\\mingw64\\bin`);
}
}
else {
core.addPath(`C:\\Rtools\\bin`);
if (core.getInput("windows-path-include-mingw")) {
if (core.getInput("windows-path-include-mingw") === "true") {
core.addPath(`C:\\Rtools\\mingw_64\\bin`);
}
}
Expand Down Expand Up @@ -365,8 +365,8 @@ function setupRLibrary() {
core.debug("R profile is at " + profilePath);
let rspm = process.env["RSPM"] ? `'${process.env["RSPM"]}'` : "NULL";
let cran = `'${process.env["CRAN"] || "https://cloud.r-project.org"}'`;
let user_agent = core.getInput("http-user-agent") == "default" ||
core.getInput("http-user-agent") == ""
let user_agent = core.getInput("http-user-agent") === "default" ||
core.getInput("http-user-agent") === ""
? 'sprintf("R/%s R (%s) on GitHub Actions", getRversion(), paste(getRversion(), R.version$platform, R.version$arch, R.version$os))'
: `"${core.getInput("http-user-agent")}"`;
yield fs.promises.writeFile(profilePath, `options(\
Expand Down
10 changes: 5 additions & 5 deletions setup-r/src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async function acquireR(version: string, rtoolsVersion: string) {
acquireUtilsMacOS(),
acquireRMacOS(version)
]);
if (core.getInput("remove-openmp-macos")) {
if (core.getInput("remove-openmp-macos") === "true") {
await removeOpenmpFlags();
}
} else {
Expand Down Expand Up @@ -319,12 +319,12 @@ async function acquireRtools(version: string) {
}
if (rtools4) {
core.addPath(`C:\\rtools40\\usr\\bin`);
if (core.getInput("windows-path-include-mingw")) {
if (core.getInput("windows-path-include-mingw") === "true") {
core.addPath(`C:\\rtools40\\mingw64\\bin`);
}
} else {
core.addPath(`C:\\Rtools\\bin`);
if (core.getInput("windows-path-include-mingw")) {
if (core.getInput("windows-path-include-mingw") === "true") {
core.addPath(`C:\\Rtools\\mingw_64\\bin`);
}
}
Expand Down Expand Up @@ -356,8 +356,8 @@ async function setupRLibrary() {
let rspm = process.env["RSPM"] ? `'${process.env["RSPM"]}'` : "NULL";
let cran = `'${process.env["CRAN"] || "https://cloud.r-project.org"}'`;
let user_agent =
core.getInput("http-user-agent") == "default" ||
core.getInput("http-user-agent") == ""
core.getInput("http-user-agent") === "default" ||
core.getInput("http-user-agent") === ""
? 'sprintf("R/%s R (%s) on GitHub Actions", getRversion(), paste(getRversion(), R.version$platform, R.version$arch, R.version$os))'
: `"${core.getInput("http-user-agent")}"`;

Expand Down

0 comments on commit 30e0be0

Please sign in to comment.