From e17c5ea7ebdf9f04d606b35ba0e8fb133e26d624 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Thu, 13 Mar 2025 12:36:12 -0500 Subject: [PATCH] Handle exec error Apparently this exec errors when the subprocess fails rather than returning an error code. This causes the whole setup process to terminate. This patch catches the error and uses that to indicate failure to launch. --- common.js | 2 +- dist/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common.js b/common.js index f66798e..c8b8614 100644 --- a/common.js +++ b/common.js @@ -409,7 +409,7 @@ export async function setupJavaHome() { await measure("Modifying JAVA_HOME for JRuby", async () => { console.log("attempting to run with existing JAVA_HOME") - let ret = await exec.exec('ruby', ['--version']) + let ret = await exec.exec('ruby', ['--version'], {ignoreReturnCode: true}) if (ret === 0) { console.log("JRuby successfully starts, using existing JAVA_HOME") diff --git a/dist/index.js b/dist/index.js index 1c0de8e..a657f40 100644 --- a/dist/index.js +++ b/dist/index.js @@ -729,7 +729,7 @@ async function setupJavaHome() { await measure("Modifying JAVA_HOME for JRuby", async () => { console.log("attempting to run with existing JAVA_HOME") - let ret = await exec.exec('ruby', ['--version']) + let ret = await exec.exec('ruby', ['--version'], {ignoreReturnCode: true}) if (ret === 0) { console.log("JRuby successfully starts, using existing JAVA_HOME")