Skip to content

Commit

Permalink
fix: replace std::env::current_dir with cargo env var CARGO_MANIFEST_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
Parker Jones authored and icsmw committed Apr 16, 2024
1 parent 22a1d59 commit 79db17a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ pub fn setup() -> Result<(), E> {
{
return Ok(());
}
let root = std::env::current_dir()?;
let manifest_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR is not set");
let root = PathBuf::from(manifest_dir);

let cargo = root.join("Cargo.toml");
if !cargo.exists() {
return Err(E::FileNotFound(format!(
Expand Down

0 comments on commit 79db17a

Please sign in to comment.