aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/meta/read_config_files.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdp/meta/read_config_files.d')
-rw-r--r--src/sdp/meta/read_config_files.d127
1 files changed, 2 insertions, 125 deletions
diff --git a/src/sdp/meta/read_config_files.d b/src/sdp/meta/read_config_files.d
index 554f740..74c5a12 100644
--- a/src/sdp/meta/read_config_files.d
+++ b/src/sdp/meta/read_config_files.d
@@ -4,80 +4,6 @@
meta_config_files.d
+/
module sdp.meta.read_config_files;
-static template configReadInSiteSDL() {
- import
- sdp.meta,
- sdp.output.paths_source,
- std.file,
- std.path;
- final string configReadInSiteSDL(M,E)(M manifest, E env) {
- auto conf_file_details = ConfigFilePaths!()(manifest, env);
- string conf_sdl = conf_file_details.config_filename_site_sdl;
- auto possible_config_path_locations = conf_file_details.possible_config_path_locations.config_local_site;
- string config_file_str;
- debug(io) {
- writeln("WARNING (io debug) in config filename: ", conf_sdl);
- writeln("WARNING (io debug) in config possible path locations: ", possible_config_path_locations);
- }
- foreach(pth; possible_config_path_locations) {
- auto conf_file = asNormalizedPath(chainPath(to!string(pth), conf_sdl)).array;
- if (config_file_str.length > 0) {
- break;
- }
- try {
- if (exists(conf_file)) {
- debug(io) {
- writeln("WARNING (io debug) in config file found: ", conf_file);
- }
- config_file_str = conf_file.readText;
- break;
- }
- }
- catch (ErrnoException ex) {
- }
- catch (FileException ex) {
- }
- }
- return config_file_str;
- }
-}
-static template configReadInDocSDL() {
- import
- sdp.meta,
- sdp.output.paths_source,
- std.file,
- std.path;
- final string configReadInDocSDL(M,E)(M manifest, E env) {
- auto conf_file_details = ConfigFilePaths!()(manifest, env);
- string conf_sdl = conf_file_details.config_filename_document_sdl;
- auto possible_config_path_locations = conf_file_details.possible_config_path_locations.sisu_document_make;
- string config_file_str;
- debug(io) {
- writeln("WARNING (io debug) in config filename: ", conf_sdl);
- writeln("WARNING (io debug) in config possible path locations: ", possible_config_path_locations);
- }
- foreach(pth; possible_config_path_locations) {
- auto conf_file = asNormalizedPath(chainPath(to!string(pth), conf_sdl)).array;
- if (config_file_str.length > 0) {
- break;
- }
- try {
- if (exists(conf_file)) {
- debug(io) {
- writeln("WARNING (io debug) in config file found: ", conf_file);
- }
- config_file_str = conf_file.readText;
- break;
- }
- }
- catch (ErrnoException ex) {
- }
- catch (FileException ex) {
- }
- }
- return config_file_str;
- }
-}
static template configReadInSiteTOML() {
import
sdp.meta,
@@ -152,25 +78,6 @@ static template configReadInDocTOML() {
return config_file_str;
}
}
-static template configSDLang() {
- import sdlang;
- import
- sdp.meta,
- sdp.output.paths_source,
- std.file,
- std.path;
- auto configSDLang(string configuration, string conf_sdl_filename) {
- Tag sdl_root_conf;
- try {
- sdl_root_conf = parseSource(configuration);
- }
- catch(ParseException e) {
- stderr.writeln("SDLang problem with content for ", conf_sdl_filename);
- stderr.writeln(e.msg);
- }
- return sdl_root_conf;
- }
-}
static template configTOML() {
import toml; //
import
@@ -201,7 +108,7 @@ static template readConfigSite() {
string conf_filename = "NONE";
auto _conf_file_details = ConfigFilePaths!()(_manifest, _env);
auto possible_config_path_locations = _conf_file_details.possible_config_path_locations.config_local_site;
- foreach(conf_fn; [_conf_file_details.config_filename_site_toml, _conf_file_details.config_filename_site_sdl]) {
+ foreach(conf_fn; [_conf_file_details.config_filename_site_toml]) {
foreach(pth; possible_config_path_locations) {
auto conf_file = asNormalizedPath(chainPath(to!string(pth), conf_fn)).array;
conf_filename = conf_fn;
@@ -251,7 +158,7 @@ static template readConfigDoc() {
string conf_filename = "NONE";
auto _conf_file_details = ConfigFilePaths!()(_manifest, _env);
auto possible_config_path_locations = _conf_file_details.possible_config_path_locations.sisu_document_make;
- foreach(conf_fn; [_conf_file_details.config_filename_document_toml, _conf_file_details.config_filename_document_sdl]) {
+ foreach(conf_fn; [_conf_file_details.config_filename_document_toml]) {
foreach(pth; possible_config_path_locations) {
auto conf_file = asNormalizedPath(chainPath(to!string(pth), conf_fn)).array;
conf_filename = conf_fn;
@@ -289,36 +196,6 @@ static template readConfigDoc() {
return _ConfContent();
}
}
-static template configReadSiteSDLang() {
- import
- sdp.meta,
- sdp.output.paths_source,
- std.file,
- std.path;
- import sdlang;
- final auto configReadSiteSDLang(M,E)(M manifest, E env) {
- auto configuration = configReadInSiteSDL!()(manifest, env);
- auto conf_file_details = ConfigFilePaths!()(manifest, env);
- string conf_sdl = conf_file_details.config_filename_site_sdl;
- auto sdl_root = configSDLang!()(configuration, conf_sdl);
- return sdl_root;
- }
-}
-static template configReadDocSDLang() {
- import
- sdp.meta,
- sdp.output.paths_source,
- std.file,
- std.path;
- import sdlang;
- final auto configReadDocSDLang(M,E)(M manifest, E env) {
- auto configuration = configReadInDocSDL!()(manifest, env);
- auto conf_file_details = ConfigFilePaths!()(manifest, env);
- string conf_sdl = conf_file_details.config_filename_document_sdl;
- auto sdl_root = configSDLang!()(configuration, conf_sdl);
- return sdl_root;
- }
-}
static template configReadSiteTOML() {
import
sdp.meta,