diff options
Diffstat (limited to 'src/sdp/output/paths_source.d')
-rw-r--r-- | src/sdp/output/paths_source.d | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/src/sdp/output/paths_source.d b/src/sdp/output/paths_source.d index ac5e703..9f377bc 100644 --- a/src/sdp/output/paths_source.d +++ b/src/sdp/output/paths_source.d @@ -30,7 +30,7 @@ template PodManifest() { _manifest_path = _pth; } else if (_pth.match(rgx.src_pth_contents) && exists(_pth)!=0 && _pth.isFile) { - _manifest_path = dirName(_pth); + _manifest_path = _pth.dirName; } else if (_pth.match(rgx.src_pth_pod_sst_or_ssm) && exists(_pth)!=0 && (_pth.isFile)) { if (auto m = _pth.match(rgx.src_pth_pod_sst_or_ssm)) { @@ -480,7 +480,7 @@ template SiSUpathsSRC() { static auto rgx = Rgx(); auto SiSUpathsSRC(D,Fn)( D _pwd, - Fn _fn_src_and_relative_path, + Fn _fn_src_and_path, ) { struct SisuSrcPaths { auto pwd() { @@ -489,7 +489,7 @@ template SiSUpathsSRC() { auto language() { // use command line info as well? string _k; - if (auto m = _fn_src_and_relative_path.match(rgx.language_code_and_filename)) { + if (auto m = _fn_src_and_path.match(rgx.language_code_and_filename)) { _k = m.captures[1]; } else { /+ unknown until doc_meta read, (could provide & use command line info?) +/ _k = "xx"; // original default was "en" but is not known @@ -514,11 +514,29 @@ template SiSUpathsSRC() { auto doc_src_fn_with_path_for_text_root_and_lng() { return asNormalizedPath(text_root.chainPath(language)).array; } - auto doc_src_with_relative_path() { - return asNormalizedPath(pwd.chainPath(_fn_src_and_relative_path)).array; - } auto doc_src_fn() { - return asNormalizedPath(_fn_src_and_relative_path.baseName).array; + return asNormalizedPath(_fn_src_and_path.baseName).array; + } + auto doc_src_with_path() { + return asNormalizedPath(pwd.chainPath(_fn_src_and_path)).array; + } + auto src_image_root_with_path() { + string[] _possible_img_pth = [ + asNormalizedPath(pwd.chainPath((_fn_src_and_path).dirName ~ "/image")).array, + asNormalizedPath(pwd.chainPath((_fn_src_and_path).dirName ~ "/../image")).array, + asNormalizedPath(pwd.chainPath((_fn_src_and_path).dirName ~ "/../../image")).array, + ]; + string _img_pth_found = ""; + foreach(_img_pth; _possible_img_pth) { + if (exists(_img_pth)) { + _img_pth_found = _img_pth; + break; + } + } + if (_img_pth_found.empty) { + writeln("WARNING not image path found, searched: ", _possible_img_pth); + } + return _img_pth_found; } } return SisuSrcPaths(); |