Crates.io | project-root |
lib.rs | project-root |
version | 0.2.2 |
source | src |
created_at | 2021-02-11 20:44:43.59917 |
updated_at | 2021-02-16 19:26:33.784557 |
description | Simple utility to return the absolute path to your project root |
homepage | |
repository | https://github.com/neilwashere/rust-project-root |
max_upload_size | |
id | 353936 |
size | 3,681 |
A simple utility to obtain the absolute path to your project root.
match project_root::get_project_root() {
Ok(p) => println!("Current project root is {:?}", p),
Err(e) => println!("Error obtaining project root {:?}", e)
};
I was trying to slurp in some config files during a test but the directory location was not what I expected - and indeed would not be the final location of that directory on a deployment.
I couldn't find an immediately obvious way of finding out my position relative to the project root so built this little helper.