diff options
author | Ralph Amissah <ralph@amissah.com> | 2017-11-27 20:35:14 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:14 -0400 |
commit | 6dc69228f20b3566320b52966b3782d633171e71 (patch) | |
tree | 893201ffbd3bbd6c1ccb595be2af8354593cb49a /src/sdp/meta/read_config_files.d | |
parent | 0.20.1 struct for opt_actions (diff) |
0.20.2 paths, config & manifest files
Diffstat (limited to 'src/sdp/meta/read_config_files.d')
-rw-r--r-- | src/sdp/meta/read_config_files.d | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/src/sdp/meta/read_config_files.d b/src/sdp/meta/read_config_files.d index 012ccb6..369d9c2 100644 --- a/src/sdp/meta/read_config_files.d +++ b/src/sdp/meta/read_config_files.d @@ -7,32 +7,11 @@ module sdp.meta.read_config_files; static template configIn() { import sdp.meta, + sdp.output.paths_source, 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, - "/etc/sisu" - ]; + auto possible_config_path_locations = ConfigFilePaths!()(env).possible_config_path_locations; string config_file_str; foreach(pth; possible_config_path_locations) { auto conf_file = format( @@ -67,6 +46,7 @@ static template ConfigSDLang() { import sdlang; import sdp.meta, + sdp.output.paths_source, std.file, std.path; auto ConfigSDLang(string configuration, string conf_sdl_filename) { @@ -86,6 +66,7 @@ static template ConfigSDLang() { static template configRead() { import sdp.meta, + sdp.output.paths_source, std.file, std.path; |