From 4998414e68ccd98563315d67e6aa9b0e073dffe5 Mon Sep 17 00:00:00 2001 From: JesusPerez Date: Wed, 8 Sep 2021 20:48:33 +0100 Subject: [PATCH] chore: fix APP_HOME with '.' as default --- app_env/src/appinfo.rs | 2 +- app_env/src/config.rs | 2 +- kloud/src/utils.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app_env/src/appinfo.rs b/app_env/src/appinfo.rs index 4f9f195..2e2e0cf 100644 --- a/app_env/src/appinfo.rs +++ b/app_env/src/appinfo.rs @@ -31,7 +31,7 @@ impl AppInfo { } } pub fn load_data(&self,app_env: &AppEnv) -> Self { - let usedata = match std::fs::read_to_string(format!("{}/{}/.use",&envmnt::get_or("APP_HOME", ""),app_env.get_curr_websrvr_config().home_path)) { + let usedata = match std::fs::read_to_string(format!("{}/{}/.use",&envmnt::get_or("APP_HOME", "."),app_env.get_curr_websrvr_config().home_path)) { Ok(res) => res, // Err(e) => { println!("Error usedata: {}",e); String::from("")}, Err(_) => String::from(""), diff --git a/app_env/src/config.rs b/app_env/src/config.rs index a40982c..91cd0a8 100644 --- a/app_env/src/config.rs +++ b/app_env/src/config.rs @@ -171,7 +171,7 @@ impl Config { if verbose != "quiet" { println!("Config Loaded successfully"); } - let app_home=envmnt::get_or("APP_HOME", ""); + let app_home=envmnt::get_or("APP_HOME", "."); // if app_home.is_empty() { // cfg // } else { diff --git a/kloud/src/utils.rs b/kloud/src/utils.rs index c99973b..d67fe09 100644 --- a/kloud/src/utils.rs +++ b/kloud/src/utils.rs @@ -12,7 +12,7 @@ pub fn load_from_module(env: AppEnv, coll_key: &str) -> (String,String) { if let Some(module) = env.modules.get(coll_key) { match module.stores.to_owned().as_str() { "file" => { - let store_root =format!("{}/{}/{}",&envmnt::get_or("APP_HOME", ""),&env.get_curr_websrvr_config().home_path,&module.store_root); + let store_root =format!("{}/{}/{}",&envmnt::get_or("APP_HOME", "."),&env.get_curr_websrvr_config().home_path,&module.store_root); (module.store_frmt.to_owned(), load_fs_content(&store_root, &module.store_path, &module.store_frmt)) }, _ => {