diff options
Diffstat (limited to 'src/sdp/output/paths_source.d')
-rw-r--r-- | src/sdp/output/paths_source.d | 67 |
1 files changed, 46 insertions, 21 deletions
diff --git a/src/sdp/output/paths_source.d b/src/sdp/output/paths_source.d index d141b86..731fff3 100644 --- a/src/sdp/output/paths_source.d +++ b/src/sdp/output/paths_source.d @@ -24,19 +24,30 @@ template PodManifest() { } auto pod_manifest_path() { string _manifest_path; - if (isValidPath(_pth) && _pth.isDir - && ((_pth.chainPath(pod_manifest_filename).array).isFile)) { + if ((isValidPath(_pth) && exists(_pth)!=0 && _pth.isDir) + && (exists(_pth.chainPath(pod_manifest_filename).array)!=0 + && (_pth.chainPath(pod_manifest_filename).array).isFile)) { _manifest_path = _pth; } else if (_pth.match(rgx.src_pth_contents) - && (_pth.isFile)) { + && exists(_pth)!=0 && _pth.isDir && (_pth.isFile)) { _manifest_path = dirName(_pth); - // } else { // _manifest_path = ""; + } else { + _manifest_path = _pth; // _manifest_path = null; } return _manifest_path; } - auto pod_manifest_file_with_path() { - string _manifest_path_and_file = pod_manifest_path.chainPath(pod_manifest_filename).array; - return _manifest_path_and_file; + string pod_manifest_file_with_path() { + string _k; + if (exists(pod_manifest_path.chainPath(pod_manifest_filename).array)!=0) { + _k = pod_manifest_path.chainPath(pod_manifest_filename).array; + } else if (exists(pod_manifest_path)!=0) { + _k = pod_manifest_path; + } + if (exists(_k)==0) { + writeln("ERROR >> Processing Skipped! Manifest not found: ", _k); + _k = null; + } + return _k; } } return ManifestFile_(); @@ -139,6 +150,9 @@ template PathMatters() { } return _k; } + auto language() { + return lng(); + } auto file_with_absolute_path() { string _pth = _env["pwd"].chainPath(path_and_fn).array; return _pth; @@ -153,13 +167,15 @@ template PathMatters() { auto m = (absolute_path_to_src) .match(regex(r"[/](?P<dir>(?:[a-zA-Z0-9._-]+))/sisupod/" ~ filename.stripExtension)) ) { - _dir = asAbsolutePath(path_and_fn.chainPath("../../")).array; + _dir = asNormalizedPath(path_and_fn.chainPath("../../")).array; assert(_dir == m.captures["dir"]); } else { - _dir = asAbsolutePath(path_and_fn.chainPath("../../../")).array; + _dir = asNormalizedPath(path_and_fn.chainPath("../../../")).array; assert(_dir == absolute_path_to_src.match(rgx.src_base_parent_dir_name).captures["dir"]); } - writeln("--> ", _dir); + if ((_opt_actions.debug_do)) { + writeln("--> (base_dir) ", _dir); + } return _dir; } auto base_parent_dir_path() { @@ -168,35 +184,42 @@ template PathMatters() { auto m = (absolute_path_to_src) .match(regex(r"[/](?P<dir>(?:[a-zA-Z0-9._-]+))/sisupod/" ~ filename.stripExtension)) ) { - _dir = asAbsolutePath(path_and_fn.chainPath("../../")).array; + _dir = asNormalizedPath(path_and_fn.chainPath("../../")).array; } else { - _dir = asAbsolutePath(path_and_fn.chainPath("../../../")).array; + _dir = asNormalizedPath(path_and_fn.chainPath("../../../")).array; } return _dir; } auto base_dir_path() { // looks like there is work to do string _dir; - if ( // TODO this should catch generated --source sisupod, untested, needs manifest + if ( auto m = (absolute_path_to_src) - .match(regex(r"[/](?P<dir>(?:[a-zA-Z0-9._-]+))/sisupod/" ~ filename.stripExtension)) + .match(rgx.src_formalised_file_path_parts) + ) { + _dir = asNormalizedPath(m.captures["pth"]).array; + } else if ( // TODO this should catch generated --source sisupod, untested, needs manifest + auto m = (absolute_path_to_src) + .match(regex(r"[/](?P<dir>(?:[a-zA-Z0-9._-]+))/sisupod/" ~ filename.stripExtension)) ) { - _dir = asAbsolutePath(path_and_fn.chainPath("../")).array; + _dir = asNormalizedPath(path_and_fn.chainPath("../")).array; } else { - _dir = asAbsolutePath(path_and_fn.chainPath("../../")).array; + _dir = asNormalizedPath(path_and_fn.chainPath("../../")).array; + } + if ((_opt_actions.debug_do)) { + writeln("--> (base_dir_path) ", _dir); } - writeln("--> ", _dir); return _dir; } auto media_dir_path() { // TODO rework, can base directly on src fn path - auto _dir = asAbsolutePath(base_dir_path.chainPath("media")).array; + string _dir = asNormalizedPath(base_dir_path.chainPath("media")).array; return _dir; } auto image_dir_path() { - auto _dir = asAbsolutePath(base_dir_path.chainPath("media/image")).array; + string _dir = asNormalizedPath(base_dir_path.chainPath("media/image")).array; return _dir; } auto conf_dir_path() { - auto _dir = asAbsolutePath(base_dir_path.chainPath("conf")).array; + auto _dir = asNormalizedPath(base_dir_path.chainPath("conf")).array; return _dir; } auto base_parent_dir() { @@ -209,7 +232,9 @@ template PathMatters() { } else { _dir = (absolute_path_to_src).match(rgx.src_base_parent_dir_name).captures["dir"]; } - writeln("--> ", _dir); + if ((_opt_actions.debug_do)) { + writeln("--> (base_parent_dir) ", _dir); + } return _dir; } auto config_dirs() { // TODO |