From db96528baa55151826442f61ddfea2cd006ef68d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 4 Apr 2020 17:25:56 -0400 Subject: config, where used without document processing --- org/default_paths.org | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'org/default_paths.org') diff --git a/org/default_paths.org b/org/default_paths.org index 20dae9e..3af1019 100644 --- a/org/default_paths.org +++ b/org/default_paths.org @@ -49,7 +49,7 @@ template PodManifest() { mixin spineRgxIn; static auto rgx = RgxI(); @safe auto PodManifest(O)( - O _opt_actions, + O _opt_action, string _pth="" ) { struct ManifestFile_ { @@ -71,10 +71,10 @@ template PodManifest() { _manifest_path = m.captures["podpath"]; } } else { - if (_opt_actions.verbose || _opt_actions.very_verbose || _opt_actions.debug_do) { + if (_opt_action.verbose || _opt_action.very_verbose || _opt_action.debug_do) { writeln("WARNING, src is not a pod, issue with manifest_path: ", _pth); // remove? unless can distinguish pod } - _manifest_path = null; // _manifest_path = ""; + _manifest_path = ""; } return _manifest_path; } @@ -126,13 +126,13 @@ template PathMatters() { static auto rgx = RgxI(); static auto mkup = InlineMarkup(); @safe auto PathMatters(O,E)( - O _opt_actions, + O _opt_action, E _env, string _pth, string _fns = "", char[][] _manifest_fn_list = [[]], ) { - @safe auto _manifested = PodManifest!()(_opt_actions, _pth); + @safe auto _manifested = PodManifest!()(_opt_action, _pth); struct ManifestMatters_ { auto env() { auto _env = _env; @@ -149,7 +149,7 @@ template PathMatters() { @safe auto opt() { struct Opt_ { auto action() { - return _opt_actions; + return _opt_action; } } return Opt_(); @@ -208,7 +208,7 @@ template PathMatters() { } @safe auto src() { string _fns = _fns; // required here by dmd & not by ldc (for D:2078) - auto _opt_actions = _opt_actions; + auto _opt_action = _opt_action; auto _env = _env; struct SRC_ { @safe bool is_pod() { @@ -323,7 +323,7 @@ template PathMatters() { assert(_dir == absolute_path_to_src .match(rgx.src_base_parent_dir_name).captures["dir"]); } - if (_opt_actions.debug_do) { + if (_opt_action.debug_do) { writeln("--> (base_dir) ", _dir); } return _dir; @@ -355,7 +355,7 @@ template PathMatters() { } else { _dir = ((path_and_fn.chainPath("../../")).asNormalizedPath).array; } - if (_opt_actions.debug_do) { + if (_opt_action.debug_do) { writeln("--> (base_dir_path) ", _dir); } return _dir; @@ -401,7 +401,7 @@ template PathMatters() { } else { _dir = (absolute_path_to_src).match(rgx.src_base_parent_dir_name).captures["dir"]; } - if (_opt_actions.debug_do) { + if (_opt_action.debug_do) { writeln("--> (base_parent_dir) ", _dir); } return _dir; @@ -437,10 +437,10 @@ template PathMatters() { struct Out_ { @safe auto path() { auto _output_path = _env["pwd"]; - if ((_opt_actions.output_dir_set.length > 0) - && isValidPath(_opt_actions.output_dir_set) + if ((_opt_action.output_dir_set.length > 0) + && isValidPath(_opt_action.output_dir_set) ) { - _output_path = ((_opt_actions.output_dir_set).asNormalizedPath).array; + _output_path = ((_opt_action.output_dir_set).asNormalizedPath).array; if (!exists(_output_path)) { try { _output_path.mkdirRecurse; @@ -468,10 +468,10 @@ template PathMatters() { #+NAME: template_paths_src #+BEGIN_SRC d -template ConfigFilePaths() { +template configFilePaths() { mixin spineRgxIn; static auto rgx = RgxI(); - @safe auto ConfigFilePaths(M,E)( + @safe auto configFilePaths(M,E)( M _manifested, E _env, string _cli_config_path_set = "" @@ -524,10 +524,9 @@ template ConfigFilePaths() { _dr_doc_conf_pwd_d, ]; } - } else { - _possible_config_path_locations = [ - _cli_config_path_set - ]; + } else if (_cli_config_path_set.isDir) { + _possible_config_path_locations = [_cli_config_path_set ]; + // } else if (_cli_config_path_set.isFile) { // use file, taken care of elsewhere } /+ FIX clean up conf paths ↑ (compare pwd to doc path location, and build config path) @@ -549,10 +548,10 @@ template ConfigFilePaths() { _possible_config_path_locations = [ _dot_pwd, _underscore_pwd, + _collection_root_a, + _collection_root_b, _dot_home, "/etc/dr", - _collection_root_a, // set priority higher? - _collection_root_b // set priority higher? ]; } else { /+ config document (& or local site) on filesystem +/ -- cgit v1.2.3