Skip to main content

get_working_dir

Function get_working_dir 

Source
pub fn get_working_dir() -> Result<PathBuf, Error>
Expand description

Returns the directory where the current executable is located.

§Errors

Returns an error if the executable path cannot be determined or if the path has no parent directory.

§Example

use ghpascon_rust::utils::path::get_working_dir;

let dir = get_working_dir().expect("could not determine executable directory");
println!("running from: {}", dir.display());