pub fn find_project_root(cwd: Option<&Path>) -> Result<PathBuf>Expand description
Returns the root path to set for the project root.
Traverse the dir tree up and look for a foundry.toml file starting at the given path or cwd,
but only until the root dir of the current repo so that:
-- foundry.toml
-- repo
|__ .git
|__sub
|__ [given_path | cwd]will still detect repo as root.
Returns repo or cwd if no foundry.toml is found in the tree.
Returns an error if:
cwdisSomeand is not a valid directory;cwdisNoneand thestd::env::current_dircall fails.