Skip to content

Commit 7ffdbb4

Browse files
committed
Cleanup based on review
1 parent 2502fcd commit 7ffdbb4

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

common.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -410,23 +410,28 @@ export async function setupJavaHome() {
410410
core.startGroup(`Modifying JAVA_HOME for JRuby`)
411411

412412
console.log("attempting to run with existing JAVA_HOME")
413-
let ret = await exec.exec('ruby', ['--version']);
413+
414+
let ret = await exec.exec('ruby', ['--version'])
414415

415416
if (ret === 0) {
416417
console.log("JRuby successfully starts, using existing JAVA_HOME")
417418
} else {
418419
console.log("JRuby failed to start, try Java 21 envs")
420+
419421
let arch = os.arch();
420-
if (arch == "x64" || os.platform() != "darwin") {
422+
if (arch === "x64" || os.platform() !== "darwin") {
421423
arch = "X64"
422424
}
423-
let newHomeVar = `JAVA_HOME_21_${arch}`;
424-
let newHome = process.env[newHomeVar];
425+
426+
let newHomeVar = `JAVA_HOME_21_${arch}`
427+
let newHome = process.env[newHomeVar]
425428

426429
if (newHome === "undefined") {
427430
throw new Error(`JAVA_HOME is not Java 21+ needed for JRuby and \$${newHomeVar} is not defined`)
428431
}
432+
429433
console.log(`Setting JAVA_HOME to ${newHomeVar} path ${newHome}`)
434+
430435
core.exportVariable("JAVA_HOME", newHome)
431436
}
432437

dist/index.js

+11-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ export async function setupRuby(options = {}) {
7979

8080
const rubyPrefix = await installer.install(platform, engine, version)
8181

82-
if (engine == "jruby") {
83-
await common.setupJavaHome();
82+
if (engine === "jruby") {
83+
await common.setupJavaHome()
8484
}
8585

8686
await common.measure('Print Ruby version', async () =>

0 commit comments

Comments
 (0)