From 8577facf7e0f06580d289ed5bf8cbded3ad2a9f1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 16 Dec 2017 16:06:29 -0500 Subject: target different type of config file locations - config files for - local site configuration (not in pod) - document make (included in pod) --- org/default_paths.org | 65 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 22 deletions(-) (limited to 'org/default_paths.org') diff --git a/org/default_paths.org b/org/default_paths.org index e18d3a5..93711dc 100644 --- a/org/default_paths.org +++ b/org/default_paths.org @@ -199,25 +199,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" @@ -232,17 +222,48 @@ 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, + _sisudoc_conf_pwd_a, + _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, -- cgit v1.2.3