Getting ready for BG
This commit is contained in:
8
aether_app_native.code-workspace
Normal file
8
aether_app_native.code-workspace
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
],
|
||||
"settings": {}
|
||||
}
|
||||
@@ -45,12 +45,8 @@ exports.load_config = function () {
|
||||
if (cwd == '/') {
|
||||
cwd = home_directory;
|
||||
}
|
||||
let directory_list = fs_promises.readdir(cwd).then(function (read_dir_result) {
|
||||
console.log('CWD Contents:', read_dir_result);
|
||||
// for (let file of read_dir_result) {
|
||||
// console.log(file);
|
||||
// }
|
||||
});
|
||||
let directory_list = fs.readdirSync(cwd)
|
||||
console.log('CWD Contents:', directory_list);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
@@ -65,7 +61,7 @@ exports.load_config = function () {
|
||||
let config_directory = null;
|
||||
// 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);
|
||||
console.log(`Default Config File (path): ${default_config_path}`);
|
||||
let config_path = null;
|
||||
|
||||
// Set the config path for macOS or Linux
|
||||
@@ -94,7 +90,7 @@ exports.load_config = function () {
|
||||
|
||||
// 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 file (config.json) found under ${config_directory}`);
|
||||
console.log(`Config file (aether_native_app_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);
|
||||
@@ -126,18 +122,18 @@ exports.load_config = function () {
|
||||
}
|
||||
|
||||
config = JSON.parse(fs.readFileSync(config_path));
|
||||
console.log('Config file read.');
|
||||
console.log('Config file read.', config);
|
||||
|
||||
config.home_directory = home_directory; // From the OS platform
|
||||
config.tmp_directory = tmp_directory; // From the OS platform
|
||||
|
||||
config.app_root_path = config.app_root_path.replace('[home]', home_directory);
|
||||
config.app_root_path = config.app_root_path.replace('[tmp]', tmp_directory);
|
||||
console.log(config.app_root_path);
|
||||
console.log(`App Root Path: ${config.app_root_path}`);
|
||||
|
||||
config.local_file_cache_path = config.local_file_cache_path.replace('[home]', home_directory);
|
||||
config.local_file_cache_path = config.local_file_cache_path.replace('[tmp]', tmp_directory);
|
||||
console.log(config.local_file_cache_path);
|
||||
console.log(`Local File Cache Path: ${config.local_file_cache_path}`);
|
||||
if (fs.existsSync(config.local_file_cache_path)) {
|
||||
} else {
|
||||
fs.mkdirSync(config.local_file_cache_path);
|
||||
@@ -146,7 +142,7 @@ exports.load_config = function () {
|
||||
|
||||
config.host_file_temp_path = config.host_file_temp_path.replace('[home]', home_directory);
|
||||
config.host_file_temp_path = config.host_file_temp_path.replace('[tmp]', tmp_directory);
|
||||
console.log(config.host_file_temp_path);
|
||||
console.log(`Host file temp path: ${config.host_file_temp_path}`);
|
||||
if (fs.existsSync(config.host_file_temp_path)) {
|
||||
} else {
|
||||
fs.mkdirSync(config.host_file_temp_path);
|
||||
@@ -155,8 +151,8 @@ exports.load_config = function () {
|
||||
|
||||
let import_config_to_ipc_result = ipcRenderer.invoke('import_config', config).then((result) => {
|
||||
console.log('IPC import config finished');
|
||||
console.log(result);
|
||||
return true;
|
||||
// console.log(result);
|
||||
return result; // Result should be "true"
|
||||
})
|
||||
|
||||
//console.log(config);
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -16,7 +16,7 @@
|
||||
"path": "^0.12.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "^22.0.0",
|
||||
"electron": "^22.3.6",
|
||||
"electron-packager": "^16.0.0"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"path": "^0.12.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "^22.0.0",
|
||||
"electron": "^22.3.6",
|
||||
"electron-packager": "^16.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user