MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / resolve_path

Function resolve_path

src/config.rs:620–626  ·  view source on GitHub ↗

Resolves a CLI path argument to an absolute `PathBuf`. If `path` is `Some`, uses that value; otherwise falls back to the current working directory.

(path: Option<String>)

Source from the content-addressed store, hash-verified

618/// If `path` is `Some`, uses that value; otherwise falls back to the current
619/// working directory.
620pub fn resolve_path(path: Option<String>) -> PathBuf {
621 let path = match path {
622 Some(p) => PathBuf::from(p),
623 None => std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")),
624 };
625 absolutize_path(path)
626}
627
628fn absolutize_path(path: PathBuf) -> PathBuf {
629 if path.is_absolute() {

Callers 10

dispatch_commandFunction · 0.85
handle_branch_actionFunction · 0.85
handle_no_commandFunction · 0.85
handle_initFunction · 0.85
handle_gitignoreFunction · 0.85
handle_benchFunction · 0.85
hook_prompt_submitFunction · 0.85
hook_stopFunction · 0.85

Calls 1

absolutize_pathFunction · 0.85

Tested by 2