diff options
author | Ralph Amissah <ralph@amissah.com> | 2017-09-07 16:54:23 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:14 -0400 |
commit | 4ff01a81f048c0b496cc03627324b69b7aebd368 (patch) | |
tree | acc9ff9a86b696b294980ef051de56c95bd9a045 /src/sdp/meta/read_config_files.d | |
parent | sqlite, introduced, far to go (diff) |
0.19.0 conf make meta, composite struct, instead of associative array
* remove conf make meta associative arrays,
including native doc header (which revisit)
Diffstat (limited to 'src/sdp/meta/read_config_files.d')
-rw-r--r-- | src/sdp/meta/read_config_files.d | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/sdp/meta/read_config_files.d b/src/sdp/meta/read_config_files.d index 2410316..012ccb6 100644 --- a/src/sdp/meta/read_config_files.d +++ b/src/sdp/meta/read_config_files.d @@ -4,16 +4,30 @@ meta_config_files.d +/ module sdp.meta.read_config_files; -template configIn() { +static template configIn() { import sdp.meta, std.file, std.path; final string configIn(C,E)(C conf_sdl, E env) { + /+ FIX clean up conf paths ↓ +/ + string sisudoc_conf_pwd = chainPath(to!string(env["pwd"]), "sisudoc/conf").array; + string sisudoc_conf_pwd_a = chainPath(to!string(env["pwd"]), "conf").array; + string sisudoc_conf_pwd_b = chainPath(to!string(env["pwd"]), "../conf").array; + string sisudoc_conf_pwd_c = chainPath(to!string(env["pwd"]), "../../conf").array; + string sisudoc_conf_pwd_d = chainPath(to!string(env["pwd"]), "../../../conf").array; + /+ FIX clean up conf paths ↑ + (compare pwd to doc path location, and build config path) + +/ string dot_pwd = chainPath(to!string(env["pwd"]), ".sisu").array; string underscore_pwd = chainPath(to!string(env["pwd"]), "_sisu").array; string dot_home = chainPath(to!string(env["home"]), ".sisu").array; string[] possible_config_path_locations = [ + sisudoc_conf_pwd, + sisudoc_conf_pwd_a, + sisudoc_conf_pwd_b, + sisudoc_conf_pwd_c, + sisudoc_conf_pwd_d, dot_pwd, underscore_pwd, dot_home, @@ -26,6 +40,9 @@ template configIn() { pth, conf_sdl, ); + if (config_file_str.length > 0) { + break; + } try { if (exists(conf_file)) { debug(configfile) { @@ -46,7 +63,7 @@ template configIn() { /+ +/ -template ConfigSDLang() { +static template ConfigSDLang() { import sdlang; import sdp.meta, @@ -66,7 +83,7 @@ template ConfigSDLang() { } /+ +/ -template configRead() { +static template configRead() { import sdp.meta, std.file, |