diff options
Diffstat (limited to 'src/filestore')
-rw-r--r-- | src/filestore/path.rs | 2 | ||||
-rw-r--r-- | src/filestore/release.rs | 9 | ||||
-rw-r--r-- | src/filestore/util.rs | 5 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/filestore/path.rs b/src/filestore/path.rs index c26b9c6..eeb946d 100644 --- a/src/filestore/path.rs +++ b/src/filestore/path.rs @@ -98,7 +98,7 @@ impl StoreRoot { pub struct ArtifactPath(PathBuf); impl ArtifactPath { - pub(in crate::filestore) fn new(p: PathBuf) -> Result<Self> { + pub fn new(p: PathBuf) -> Result<Self> { if p.is_relative() { Ok(ArtifactPath(p)) } else { diff --git a/src/filestore/release.rs b/src/filestore/release.rs index d7a7232..f19f69a 100644 --- a/src/filestore/release.rs +++ b/src/filestore/release.rs @@ -13,6 +13,7 @@ use std::fmt::Debug; use anyhow::Result; use indicatif::ProgressBar; +use crate::filestore::path::ArtifactPath; use crate::filestore::path::StoreRoot; use crate::filestore::util::FileStoreImpl; @@ -29,4 +30,12 @@ impl ReleaseStore { pub fn load(root: StoreRoot, progress: ProgressBar) -> Result<Self> { FileStoreImpl::load(root, progress).map(ReleaseStore) } + + pub fn root_path(&self) -> &StoreRoot { + self.0.root_path() + } + + pub fn get(&self, p: &ArtifactPath) -> Option<&ArtifactPath> { + self.0.get(p) + } } diff --git a/src/filestore/util.rs b/src/filestore/util.rs index 0d98404..53f5919 100644 --- a/src/filestore/util.rs +++ b/src/filestore/util.rs @@ -35,7 +35,10 @@ impl FileStoreImpl { pub fn load(root: StoreRoot, progress: ProgressBar) -> Result<Self> { let store = root .find_artifacts_recursive() - .inspect(|_| progress.tick()) + .inspect(|path| { + log::trace!("Found artifact path: {:?}", path); + progress.tick(); + }) .collect::<Result<HashSet<ArtifactPath>>>()?; Ok(FileStoreImpl { root, store }) |