From c17bafcf23de23405fc180980b23e1cba99db101 Mon Sep 17 00:00:00 2001 From: luckycxr Date: Sun, 22 Jun 2025 12:59:08 -0400 Subject: [PATCH] MacOS support on RC2! Fixed the primary issue with RC2 building on MacOS where radios could not be added. Added a channel in the main.js function that clears up the problem. Also fixed a downstream problem this created where config wouldn't load correctly on first startup but reworking some code in main.js readConfig (under if config.json does not exist.) --- console/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/console/main.js b/console/main.js index f66d780..067a3d4 100644 --- a/console/main.js +++ b/console/main.js @@ -26,13 +26,15 @@ let midiInput = new midi.Input(); /** * Reads the config file and returns the JSON inside */ -async function readConfig(defaultConfig) { +async function readConfig(readConfig, defaultConfig) { // Check for existing config file if (!fs.existsSync(configPath)) { console.warn("No config.json file found, creating default at " + configPath); try { fs.writeFileSync(configPath, JSON.stringify(defaultConfig, null, 4)); - return defaultConfig; + + const configJson = fs.readFileSync(configPath, { encoding: 'utf8', flag: 'r' }); + return configJson; } catch (e) { console.error("Failed to write default config file " + configPath + "!");