systemprompt_models/paths/
web.rs1use std::path::{Path, PathBuf};
2
3use crate::profile::PathsConfig;
4
5#[derive(Debug, Clone)]
6pub struct WebPaths {
7 root: PathBuf,
8 dist: PathBuf,
9 config: PathBuf,
10 metadata: PathBuf,
11}
12
13impl WebPaths {
14 const DIST_DIR: &'static str = "dist";
15
16 pub fn from_profile(paths: &PathsConfig) -> Self {
17 let root = PathBuf::from(paths.web_path_resolved());
18 let dist = root.join(Self::DIST_DIR);
19
20 Self {
21 root,
22 dist,
23 config: PathBuf::from(paths.web_config()),
24 metadata: PathBuf::from(paths.web_metadata()),
25 }
26 }
27
28 pub fn root(&self) -> &Path {
29 &self.root
30 }
31
32 pub fn dist(&self) -> &Path {
33 &self.dist
34 }
35
36 pub fn config(&self) -> &Path {
37 &self.config
38 }
39
40 pub fn metadata(&self) -> &Path {
41 &self.metadata
42 }
43}