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 == '/') {
|
if (cwd == '/') {
|
||||||
cwd = home_directory;
|
cwd = home_directory;
|
||||||
}
|
}
|
||||||
let directory_list = fs_promises.readdir(cwd).then(function (read_dir_result) {
|
let directory_list = fs.readdirSync(cwd)
|
||||||
console.log('CWD Contents:', read_dir_result);
|
console.log('CWD Contents:', directory_list);
|
||||||
// for (let file of read_dir_result) {
|
|
||||||
// console.log(file);
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
@@ -65,7 +61,7 @@ exports.load_config = function () {
|
|||||||
let config_directory = null;
|
let config_directory = null;
|
||||||
// let default_config_path = path.join(process.cwd(),'aether_native_app_config.current.json');
|
// let default_config_path = path.join(process.cwd(),'aether_native_app_config.current.json');
|
||||||
let default_config_path = '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;
|
let config_path = null;
|
||||||
|
|
||||||
// Set the config path for macOS or Linux
|
// 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.
|
// Attempt to open the config file. The preferred location is based on the OS's config directory.
|
||||||
if (fs.existsSync(config_path)) {
|
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)) {
|
} else if (!fs.existsSync(config_path) && fs.existsSync(default_config_path)) {
|
||||||
fs.copyFileSync(default_config_path, config_path);
|
fs.copyFileSync(default_config_path, config_path);
|
||||||
console.log('Default config file copied: '+config_directory);
|
console.log('Default config file copied: '+config_directory);
|
||||||
@@ -126,18 +122,18 @@ exports.load_config = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
config = JSON.parse(fs.readFileSync(config_path));
|
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.home_directory = home_directory; // From the OS platform
|
||||||
config.tmp_directory = tmp_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('[home]', home_directory);
|
||||||
config.app_root_path = config.app_root_path.replace('[tmp]', tmp_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('[home]', home_directory);
|
||||||
config.local_file_cache_path = config.local_file_cache_path.replace('[tmp]', tmp_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)) {
|
if (fs.existsSync(config.local_file_cache_path)) {
|
||||||
} else {
|
} else {
|
||||||
fs.mkdirSync(config.local_file_cache_path);
|
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('[home]', home_directory);
|
||||||
config.host_file_temp_path = config.host_file_temp_path.replace('[tmp]', tmp_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)) {
|
if (fs.existsSync(config.host_file_temp_path)) {
|
||||||
} else {
|
} else {
|
||||||
fs.mkdirSync(config.host_file_temp_path);
|
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) => {
|
let import_config_to_ipc_result = ipcRenderer.invoke('import_config', config).then((result) => {
|
||||||
console.log('IPC import config finished');
|
console.log('IPC import config finished');
|
||||||
console.log(result);
|
// console.log(result);
|
||||||
return true;
|
return result; // Result should be "true"
|
||||||
})
|
})
|
||||||
|
|
||||||
//console.log(config);
|
//console.log(config);
|
||||||
|
|||||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -16,7 +16,7 @@
|
|||||||
"path": "^0.12.7"
|
"path": "^0.12.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"electron": "^22.0.0",
|
"electron": "^22.3.6",
|
||||||
"electron-packager": "^16.0.0"
|
"electron-packager": "^16.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
"path": "^0.12.7"
|
"path": "^0.12.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"electron": "^22.0.0",
|
"electron": "^22.3.6",
|
||||||
"electron-packager": "^16.0.0"
|
"electron-packager": "^16.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user