diff options
author | Ralph Amissah <ralph@amissah.com> | 2017-12-16 16:06:29 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:14 -0400 |
commit | 8577facf7e0f06580d289ed5bf8cbded3ad2a9f1 (patch) | |
tree | dcb62b94a7ef1af2c099ea8c70ee5f1283e30db3 /src/sdp/output/paths_source.d | |
parent | 0.23.2 config paths for pod (diff) |
target different type of config file locations
- config files for
- local site configuration (not in pod)
- document make (included in pod)
Diffstat (limited to 'src/sdp/output/paths_source.d')
-rw-r--r-- | src/sdp/output/paths_source.d | 65 |
1 files changed, 43 insertions, 22 deletions
diff --git a/src/sdp/output/paths_source.d b/src/sdp/output/paths_source.d index 4f8eb54..b81448c 100644 --- a/src/sdp/output/paths_source.d +++ b/src/sdp/output/paths_source.d @@ -156,25 +156,15 @@ template ConfigFilePaths() { E _env, ) { struct ConfFilePaths { - auto possible_config_path_locations() { + auto possible_config_path_locations_document() { /+ FIX clean up conf paths ↓ +/ /+ config local site (file system only, not in pod) +/ - string _dot_pwd; - string _underscore_pwd; - string _dot_home; - /+ config document (& or local site) on filesystem +/ - string _sisudoc_conf_pwd; // think about - string _sisudoc_conf_pwd_a; - string _sisudoc_conf_pwd_b; - string _sisudoc_conf_pwd_c; - string _sisudoc_conf_pwd_d; - /+ config document in pod +/ - string _sisudoc_conf_pod; - string _sisudoc_conf_pod_text; /+ return paths +/ string[] _possible_config_path_locations; if (_manifest.is_pod) { /+ config document in pod +/ + string _sisudoc_conf_pod; + string _sisudoc_conf_pod_text; _sisudoc_conf_pod = asNormalizedPath(chainPath( to!string(_env["pwd"]), _manifest.pod_manifest_path ~ "/conf" @@ -189,16 +179,12 @@ template ConfigFilePaths() { _sisudoc_conf_pod, ]; } else { - /+ config local site (file system only, not in pod) +/ - _dot_pwd = asNormalizedPath(chainPath(to!string(_env["pwd"]), ".sisu")).array; - _underscore_pwd = asNormalizedPath(chainPath(to!string(_env["pwd"]), "_sisu")).array; - _dot_home = asNormalizedPath(chainPath(to!string(_env["home"]), ".sisu")).array; /+ config document (& or local site) on filesystem +/ - _sisudoc_conf_pwd = asNormalizedPath(chainPath(to!string(_env["pwd"]), "sisudoc/conf")).array; // think about - _sisudoc_conf_pwd_a = asNormalizedPath(chainPath(to!string(_env["pwd"]), "conf")).array; - _sisudoc_conf_pwd_b = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../conf")).array; - _sisudoc_conf_pwd_c = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../../conf")).array; - _sisudoc_conf_pwd_d = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../../../conf")).array; + string _sisudoc_conf_pwd = asNormalizedPath(chainPath(to!string(_env["pwd"]), "sisudoc/conf")).array; // think about + string _sisudoc_conf_pwd_a = asNormalizedPath(chainPath(to!string(_env["pwd"]), "conf")).array; + string _sisudoc_conf_pwd_b = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../conf")).array; + string _sisudoc_conf_pwd_c = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../../conf")).array; + string _sisudoc_conf_pwd_d = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../../../conf")).array; /+ return paths +/ _possible_config_path_locations = [ _sisudoc_conf_pwd, @@ -206,6 +192,41 @@ template ConfigFilePaths() { _sisudoc_conf_pwd_b, _sisudoc_conf_pwd_c, _sisudoc_conf_pwd_d, + ]; + } + /+ FIX clean up conf paths ↑ + (compare pwd to doc path location, and build config path) + +/ + return _possible_config_path_locations; + } + auto possible_config_path_locations_local_site() { + /+ FIX clean up conf paths ↓ +/ + /+ config local site (file system only, not in pod) +/ + string _dot_pwd = asNormalizedPath(chainPath(to!string(_env["pwd"]), ".sisu")).array; + string _underscore_pwd = asNormalizedPath(chainPath(to!string(_env["pwd"]), "_sisu")).array; + string _dot_home = asNormalizedPath(chainPath(to!string(_env["home"]), ".sisu")).array; + /+ return paths +/ + string[] _possible_config_path_locations; + if (_manifest.is_pod) { + _possible_config_path_locations = [ + _dot_pwd, + _underscore_pwd, + _dot_home, + "/etc/sisu" + ]; + } else { + /+ config document (& or local site) on filesystem +/ + string _sisudoc_conf_pwd = asNormalizedPath(chainPath(to!string(_env["pwd"]), "sisudoc/conf")).array; // think about + string _sisudoc_conf_pwd_a = asNormalizedPath(chainPath(to!string(_env["pwd"]), "conf")).array; + string _sisudoc_conf_pwd_b = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../conf")).array; + string _sisudoc_conf_pwd_c = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../../conf")).array; + string _sisudoc_conf_pwd_d = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../../../conf")).array; + _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, |