From 2a5612933669c8bab9c37e4bc51390fda4a699d7 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Fri, 6 May 2022 16:01:08 -0400 Subject: [PATCH] Work on copy config if needed. --- app/js/aether_native_app_v3.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/js/aether_native_app_v3.js b/app/js/aether_native_app_v3.js index f4b95ae..325356c 100644 --- a/app/js/aether_native_app_v3.js +++ b/app/js/aether_native_app_v3.js @@ -57,13 +57,9 @@ exports.load_config = function () { config_path = path.join(config_directory, 'config.json'); // Attempt to open the config file. The preferred location is based on the OS's config directory. - // if (fs.existsSync(config_path)) { - // console.log(`Config path: ${config_path}`); - // console.log(`Config file (config.json) found under ${config_directory}`); - - - // } else - if (!fs.existsSync(config_path) && fs.existsSync(default_config_path)) { + if (fs.existsSync(config_path)) { + console.log(`Config file (config.json) found under ${config_directory}`); + } else if (!fs.existsSync(config_path) && fs.existsSync(default_config_path)) { fs.copyFileSync(default_config_path, config_path); console.log('Default config file copied: '+config_directory); @@ -82,7 +78,10 @@ exports.load_config = function () { //console.log('Config file (config.json) not found under '+config_directory+'. Using config in CWD.'); //config = JSON.parse(fs.readFileSync('config.json')); } else { + console.log('Unknown'); //close(); + + return false; } config = JSON.parse(fs.readFileSync(config_path));