aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/meta_read_source_files.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-12-16 17:18:01 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commit51fd56020424dcca50c4b8cfb3877640a6a9656b (patch)
tree052b45cb065e2edc6fdf470d2c09b84c21eb9937 /org/meta_read_source_files.org
parenttarget different type of config file locations (diff)
target config file locations, refine
Diffstat (limited to 'org/meta_read_source_files.org')
-rw-r--r--org/meta_read_source_files.org36
1 files changed, 18 insertions, 18 deletions
diff --git a/org/meta_read_source_files.org b/org/meta_read_source_files.org
index 69d70d7..3c92560 100644
--- a/org/meta_read_source_files.org
+++ b/org/meta_read_source_files.org
@@ -47,15 +47,13 @@ module sdp.meta.read_config_files;
#+BEGIN_SRC d
static template configInSite() {
<<imports_std>>
- final string configInSite(M,E,C)(M manifest, E env, C conf_sdl) {
- auto possible_config_path_locations = ConfigFilePaths!()(manifest, env).possible_config_path_locations_local_site;
+ final string configInSite(M,E)(M manifest, E env) {
+ auto conf_file_details = ConfigFilePaths!()(manifest, env);
+ string conf_sdl = conf_file_details.config_filename_site;
+ auto possible_config_path_locations = conf_file_details.possible_config_path_locations_local_site;
string config_file_str;
foreach(pth; possible_config_path_locations) {
- auto conf_file = format(
- "%s/%s",
- pth,
- conf_sdl,
- );
+ auto conf_file = asNormalizedPath(chainPath(to!string(pth), conf_sdl)).array;
if (config_file_str.length > 0) {
break;
}
@@ -82,15 +80,13 @@ static template configInSite() {
#+BEGIN_SRC d
static template configInDoc() {
<<imports_std>>
- final string configInDoc(M,E,C)(M manifest, E env, C conf_sdl) {
- auto possible_config_path_locations = ConfigFilePaths!()(manifest, env).possible_config_path_locations_document;
+ final string configInDoc(M,E)(M manifest, E env) {
+ auto conf_file_details = ConfigFilePaths!()(manifest, env);
+ string conf_sdl = conf_file_details.config_filename_document;
+ auto possible_config_path_locations = conf_file_details.possible_config_path_locations_document;
string config_file_str;
foreach(pth; possible_config_path_locations) {
- auto conf_file = format(
- "%s/%s",
- pth,
- conf_sdl,
- );
+ auto conf_file = asNormalizedPath(chainPath(to!string(pth), conf_sdl)).array;
if (config_file_str.length > 0) {
break;
}
@@ -175,8 +171,10 @@ Read in sdl config file name given, and return sdl root
#+name: meta_config_file_sdlang_hub_site
#+BEGIN_SRC d
-final auto configReadSite(M,E,C)(M manifest, E env, C conf_sdl) {
- auto configuration = configInSite!()(manifest, env, conf_sdl);
+final auto configReadSite(M,E)(M manifest, E env) {
+ auto configuration = configInSite!()(manifest, env);
+ auto conf_file_details = ConfigFilePaths!()(manifest, env);
+ string conf_sdl = conf_file_details.config_filename_site;
auto sdl_root = ConfigSDLang!()(configuration, conf_sdl);
return sdl_root;
}
@@ -184,8 +182,10 @@ final auto configReadSite(M,E,C)(M manifest, E env, C conf_sdl) {
#+name: meta_config_file_sdlang_hub_doc
#+BEGIN_SRC d
-final auto configReadDoc(M,E,C)(M manifest, E env, C conf_sdl) {
- auto configuration = configInDoc!()(manifest, env, conf_sdl);
+final auto configReadDoc(M,E)(M manifest, E env) {
+ auto configuration = configInDoc!()(manifest, env);
+ auto conf_file_details = ConfigFilePaths!()(manifest, env);
+ string conf_sdl = conf_file_details.config_filename_document;
auto sdl_root = ConfigSDLang!()(configuration, conf_sdl);
return sdl_root;
}