Skip to content

Commit adeb33c

Browse files
author
grtcdr
committed
Change how vergen's variables are emitted
1 parent 6ae1304 commit adeb33c

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

build.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
use std::env;
22

33
#[cfg(feature = "version")]
4-
fn commit_hash() {
5-
use vergen::{Config, ShaKind};
6-
7-
let mut config = Config::default();
8-
*config.git_mut().sha_kind_mut() = ShaKind::Short;
9-
10-
if let Err(e) = vergen::vergen(config) {
11-
eprintln!("{}", e);
12-
}
4+
fn emit_variables() -> Result<(), Box<dyn std::error::Error>> {
5+
vergen::EmitBuilder::builder().emit()?;
6+
Ok(())
137
}
148

159
fn build_macos() {
@@ -28,5 +22,5 @@ fn main() {
2822
}
2923

3024
#[cfg(feature = "version")]
31-
commit_hash()
25+
emit_variables();
3226
}

0 commit comments

Comments
 (0)