diff options
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, |