greentic_component/cmd/path.rs
1use std::path::{Path, PathBuf};
2
3/// Strip an optional `file://` URI scheme from a CLI-provided path argument.
4pub fn strip_file_scheme(original: &Path) -> PathBuf {
5 if let Some(path_str) = original.to_str()
6 && let Some(stripped) = path_str.strip_prefix("file://")
7 {
8 return PathBuf::from(stripped);
9 }
10 original.to_path_buf()
11}