We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4a2f529 + 233c63c commit 76a7669Copy full SHA for 76a7669
fil-proofs-tooling/src/metadata.rs
@@ -32,7 +32,11 @@ pub struct GitMetadata {
32
33
impl GitMetadata {
34
pub fn new() -> Result<Self, Error> {
35
- let repo_path = std::env::var("CARGO_MANIFEST_DIR")?;
+ let repo_path = if let Ok(mdir) = std::env::var("CARGO_MANIFEST_DIR") {
36
+ std::path::Path::new(&mdir).into()
37
+ } else {
38
+ std::env::current_dir()?
39
+ };
40
let repo = Repository::discover(&repo_path)?;
41
let head = repo.head()?;
42
let commit = head.peel_to_commit()?;
0 commit comments