Skip to content

Commit

Permalink
Change how vergen's variables are emitted
Browse files Browse the repository at this point in the history
  • Loading branch information
grtcdr committed Oct 6, 2023
1 parent 6ae1304 commit adeb33c
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
use std::env;

#[cfg(feature = "version")]
fn commit_hash() {
use vergen::{Config, ShaKind};

let mut config = Config::default();
*config.git_mut().sha_kind_mut() = ShaKind::Short;

if let Err(e) = vergen::vergen(config) {
eprintln!("{}", e);
}
fn emit_variables() -> Result<(), Box<dyn std::error::Error>> {
vergen::EmitBuilder::builder().emit()?;
Ok(())
}

fn build_macos() {
Expand All @@ -28,5 +22,5 @@ fn main() {
}

#[cfg(feature = "version")]
commit_hash()
emit_variables();
}

0 comments on commit adeb33c

Please sign in to comment.