From 1f390cbff2500f373721021b97ca47a813b6b671 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 28 Nov 2017 10:16:13 -0500 Subject: paths, manifest --- org/default_paths.org | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'org/default_paths.org') diff --git a/org/default_paths.org b/org/default_paths.org index 805e8a9..623584e 100644 --- a/org/default_paths.org +++ b/org/default_paths.org @@ -42,29 +42,33 @@ import sdp.meta.rgx; #+name: template_paths_src #+BEGIN_SRC d -template ManifestFile() { +template PodManifest() { mixin SiSUrgxInit; static auto rgx = Rgx(); - auto ManifestFile(P)( + auto PodManifest(P)( P _pth, ) { struct ManifestFile_ { - auto manifest_file() { + auto pod_manifest_filename() { string _manifest_file = "sisudoc.txt"; return _manifest_file; } - auto manifest_file_and_path() { - string _manifest_file_and_path; + auto pod_manifest_path() { + string _manifest_path; if (isValidPath(_pth) && _pth.isDir - && ((_pth.chainPath(manifest_file).array).isFile)) { - _manifest_file_and_path = _pth.chainPath(manifest_file).array; + && ((_pth.chainPath(pod_manifest_filename).array).isFile)) { + _manifest_path = _pth; } else if (_pth.match(rgx.src_pth_contents) && (_pth.isFile)) { - _manifest_file_and_path = _pth; + _manifest_path = dirName(_pth); } else { - // _manifest_file_and_path = ""; + // _manifest_path = ""; } - return _manifest_file_and_path; + 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; } } return ManifestFile_(); @@ -460,8 +464,9 @@ template SiSUpathsSisupods() { } auto fn_pod_filelist(string fn_src) { auto pod_root_ = pod_root(fn_src); - auto pth_1_ = "sisudoc.txt"; - auto pth_2_ = pod_root(fn_src).filesystem_open_zpod.chainPath("sisudoc.txt").array; + auto _manifest = PodManifest!()(fn_src).pod_manifest_filename; + auto pth_1_ = _manifest; + auto pth_2_ = pod_root(fn_src).filesystem_open_zpod.chainPath(_manifest).array; struct _pods { auto zpod() { return pth_1_; -- cgit v1.2.3