Skip to content

Commit 5adaadd

Browse files
committed
another check
1 parent f1d5c39 commit 5adaadd

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

tests/run-shell.mjs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,10 @@ function jsvuOSName() {
154154
const DEFAULT_JSC_LOCATION = "/System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/Helpers/jsc"
155155

156156
function testSetup() {
157-
let shellBinary;
158-
try {
159-
sh("jsvu", [`--engines=${SHELL_NAME}`, `--os=${jsvuOSName()}`]);
160-
shellBinary = path.join(os.homedir(), ".jsvu/bin", SHELL_NAME);
161-
} catch {
162-
if (SHELL_NAME == "javascriptcore")
163-
shellBinary = DEFAULT_JSC_LOCATION
164-
}
157+
sh("jsvu", [`--engines=${SHELL_NAME}`, `--os=${jsvuOSName()}`]);
158+
let shellBinary = path.join(os.homedir(), ".jsvu/bin", SHELL_NAME);
159+
if (!fs.existsSync(shellBinary) && SHELL_NAME == "javascriptcore")
160+
shellBinary = DEFAULT_JSC_LOCATION
165161
if (!fs.existsSync(shellBinary))
166162
throw new Error(`Could not find shell binary: ${shellBinary}`);
167163
log(`Installed JavaScript Shell: ${shellBinary}`);

0 commit comments

Comments
 (0)