Commit 8b4f0f91 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

version-helper: Take CARGO_MANIFEST_DIR at runtime, not at compile-time

Otherwise we'll always look at the directory of the version-helper crate
instead of the crate that is actually compiled.
parent d0e58688
Pipeline #47096 passed with stages
in 17 minutes and 19 seconds
......@@ -36,7 +36,7 @@
use chrono::TimeZone;
use git2::{Commit, ObjectType, Repository};
use std::{fs, path};
use std::{env, fs, path};
/// Extracts release for GStreamer plugin metadata
///
......@@ -77,7 +77,8 @@ pub fn get_info() {
let mut commit_id = "UNKNOWN".into();
let mut commit_date = chrono::Utc::now().format("%Y-%m-%d").to_string();
let crate_dir = path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let crate_dir =
path::PathBuf::from(env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set"));
let mut repo_dir = crate_dir.clone();
// First check for a git repository in the manifest directory and if there
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment