From b5d439a4dfcc10bf22d6bc2e600130e6b1af1050 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Fri, 2 Feb 2024 14:25:14 +0100 Subject: [PATCH] Make sure config.js doesn't break in non-Java environments --- config.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config.js b/config.js index 6ba7a6e..0cc7dfe 100644 --- a/config.js +++ b/config.js @@ -42,11 +42,17 @@ const IGNORED_NON_HTTP_PORTS = []; if (DEBUG_MODE) { // Add logging just for clean output & to separate reloads: console.log('\n*** Starting scripts ***'); - Java.perform(() => { + if (Java.available) { + Java.perform(() => { + setTimeout(() => console.log('*** Scripts completed ***\n'), 5); + // (We assume that nothing else will take more than 5ms, but app startup + // probably will, so this should separate script & runtime logs) + }); + } else { setTimeout(() => console.log('*** Scripts completed ***\n'), 5); // (We assume that nothing else will take more than 5ms, but app startup // probably will, so this should separate script & runtime logs) - }); + } } else { console.log(''); // Add just a single newline, for minimal clarity }