Skip to content

Commit c7844d5

Browse files
author
whitequark
committedNov 17, 2016
runtime: use proper format for git commit.
Fixes #620.
1 parent 18c3949 commit c7844d5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎artiq/runtime.rs/build.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ fn main() {
1313
let dest_path = Path::new(&out_dir).join("git_info.rs");
1414
let mut f = File::create(&dest_path).unwrap();
1515

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.