mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-14 06:54:20 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
922ebc4c52 |
@@ -409,7 +409,9 @@ export async function setupJavaHome(rubyPrefix) {
|
|||||||
await measure("Modifying JAVA_HOME for JRuby", async () => {
|
await measure("Modifying JAVA_HOME for JRuby", async () => {
|
||||||
console.log("attempting to run with existing JAVA_HOME")
|
console.log("attempting to run with existing JAVA_HOME")
|
||||||
|
|
||||||
let ret = await exec.exec('java', ['-jar', path.join(rubyPrefix, 'lib/jruby.jar'), '--version'], {ignoreReturnCode: true})
|
const javaHome = process.env['JAVA_HOME']
|
||||||
|
let java = javaHome ? path.join(javaHome, 'bin/java') : 'java'
|
||||||
|
let ret = await exec.exec(java, ['-jar', path.join(rubyPrefix, 'lib/jruby.jar'), '--version'], {ignoreReturnCode: true})
|
||||||
|
|
||||||
if (ret === 0) {
|
if (ret === 0) {
|
||||||
console.log("JRuby successfully starts, using existing JAVA_HOME")
|
console.log("JRuby successfully starts, using existing JAVA_HOME")
|
||||||
|
|||||||
+3
-1
@@ -729,7 +729,9 @@ async function setupJavaHome(rubyPrefix) {
|
|||||||
await measure("Modifying JAVA_HOME for JRuby", async () => {
|
await measure("Modifying JAVA_HOME for JRuby", async () => {
|
||||||
console.log("attempting to run with existing JAVA_HOME")
|
console.log("attempting to run with existing JAVA_HOME")
|
||||||
|
|
||||||
let ret = await exec.exec('java', ['-jar', path.join(rubyPrefix, 'lib/jruby.jar'), '--version'], {ignoreReturnCode: true})
|
const javaHome = process.env['JAVA_HOME']
|
||||||
|
let java = javaHome ? path.join(javaHome, 'bin/java') : 'java'
|
||||||
|
let ret = await exec.exec(java, ['-jar', path.join(rubyPrefix, 'lib/jruby.jar'), '--version'], {ignoreReturnCode: true})
|
||||||
|
|
||||||
if (ret === 0) {
|
if (ret === 0) {
|
||||||
console.log("JRuby successfully starts, using existing JAVA_HOME")
|
console.log("JRuby successfully starts, using existing JAVA_HOME")
|
||||||
|
|||||||
Reference in New Issue
Block a user