Skip to content

Commit

Permalink
runtime: use proper format for git commit.
Browse files Browse the repository at this point in the history
Fixes #620.
whitequark committed Nov 17, 2016
1 parent 18c3949 commit c7844d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions artiq/runtime.rs/build.rs
Original file line number Diff line number Diff line change
@@ -13,8 +13,10 @@ fn main() {
let dest_path = Path::new(&out_dir).join("git_info.rs");
let mut f = File::create(&dest_path).unwrap();

writeln!(f, "const GIT_COMMIT: &'static str = {:?};",
git_describe().unwrap()).unwrap();
let id = git_describe().unwrap();
let id = id.split("-").collect::<Vec<_>>();
let id = format!("{}+{}.{}", id[0], id[1], id[2]);
writeln!(f, "const GIT_COMMIT: &'static str = {:?};", id).unwrap();

println!("cargo:rerun-if-changed=../../.git/HEAD");
for entry in WalkDir::new("../../.git/refs") {

0 comments on commit c7844d5

Please sign in to comment.