Add path validation utility and integrate with CLI

This commit is contained in:
2026-03-02 20:37:31 +01:00
parent e8cf10eee3
commit 08aa198b00
6 changed files with 20 additions and 10 deletions

6
src/util/fs.rs Normal file
View File

@@ -0,0 +1,6 @@
use std::path::PathBuf;
pub fn path_exists(s: &str) -> Result<PathBuf, String> {
let p = PathBuf::from(s);
p.exists().then_some(p).ok_or("path does not exist".to_string())
}