From 14cc3d1c3e6a8e6e5e1e3a9d6bd62268461f4ccb Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Wed, 26 Oct 2022 17:34:26 -0400 Subject: [PATCH] Updated config file name --- app/js/aether_app_native_v4.js | 20 ++++++++++---------- index.js | 5 +++-- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/js/aether_app_native_v4.js b/app/js/aether_app_native_v4.js index d06b373..6cbd55d 100644 --- a/app/js/aether_app_native_v4.js +++ b/app/js/aether_app_native_v4.js @@ -63,8 +63,8 @@ exports.load_config = function () { // let config = null; let config_directory = null; - // let default_config_path = path.join(process.cwd(),'config.json.default'); - let default_config_path = 'config.json.default'; + // let default_config_path = path.join(process.cwd(),'aether_native_app_config.current.json'); + let default_config_path = 'aether_native_app_config.current.json'; console.log(default_config_path); let config_path = null; @@ -84,13 +84,13 @@ exports.load_config = function () { fs.mkdirSync(config_directory); console.log('Config directory created: '+config_directory); - //default_config_path = path.join(process.cwd(),'config.json.default'); - // config_path = path.join(config_directory, 'config.json'); + //default_config_path = path.join(process.cwd(),'aether_native_app_config.current.json'); + // config_path = path.join(config_directory, 'aether_native_app_config.json'); // fs.copyFileSync(default_config_path, config_path); // console.log('Default config file copied: '+config_directory); } - config_path = path.join(config_directory, 'config.json'); + config_path = path.join(config_directory, 'aether_native_app_config.json'); // Attempt to open the config file. The preferred location is based on the OS's config directory. if (fs.existsSync(config_path)) { @@ -101,21 +101,21 @@ exports.load_config = function () { // config = JSON.parse(fs.readFileSync(config_path)); // console.log('Config file read.'); - } else if (fs.existsSync(path.join(cwd, 'config.json'))) { + } else if (fs.existsSync(path.join(cwd, 'aether_native_app_config.json'))) { //fs.copyFileSync(default_config_path, config_path); //console.log('Default config file copied: '+config_directory); console.log(`Config file (config.json) not found under ${config_directory}. Using config in CWD. ${cwd}`); - config_path = path.join(cwd, 'config.json'); + config_path = path.join(cwd, 'aether_native_app_config.json'); console.log(`Config file (config.json) not found under ${config_directory}. Using config in CWD. ${cwd}`); - let found_config_path = path.join(cwd, 'config.json'); + let found_config_path = path.join(cwd, 'aether_native_app_config.json'); fs.copyFileSync(found_config_path, config_path); console.log(`Found config file copied: ${config_directory}`); - } else if (fs.existsSync(path.join(cwd, 'config.json.default'))) { + } else if (fs.existsSync(path.join(cwd, 'aether_native_app_config.current.json'))) { console.log(`Config file (config.json) not found under ${config_directory} or CWD. Using default config in CWD. ${cwd}`); - default_config_path = path.join(cwd, 'config.json.default'); + default_config_path = path.join(cwd, 'aether_native_app_config.current.json'); fs.copyFileSync(default_config_path, config_path); console.log(`Default config file copied: ${config_directory}`); diff --git a/index.js b/index.js index a25ad79..0acf0ff 100644 --- a/index.js +++ b/index.js @@ -29,8 +29,9 @@ if (os.platform == 'darwin') { console.log('Linux config directory: '+config_directory); } -let config_path = path.join(config_directory, 'config.json'); -// let config = null; +// let config_path = path.join(config_directory, 'config.json'); +let config_path = path.join(config_directory, 'aether_native_app_config.json'); + let config = JSON.parse(fs.readFileSync(config_path)); console.log('Config file read.', config);