1#![allow(clippy::option_if_let_else)]
2use std::path::{Path, PathBuf};
3
4#[derive(Debug, Clone, getset::Getters)]
5#[cfg_attr(feature = "serde", derive(serde::Serialize))]
6pub struct Directories {
8 #[getset(get = "pub")]
9 root: PathBuf,
11 #[getset(get = "pub")]
12 cache: PathBuf,
14 #[getset(get = "pub")]
15 staging: PathBuf,
17}
18
19impl Directories {
20 pub(crate) fn new(root: &Path) -> Self {
21 Self {
22 root: root.to_path_buf(),
23 cache: root.join(crate::directory::CACHE),
24 staging: root.join(crate::directory::STAGING),
25 }
26 }
27}