Skip to content

Commit 408c80c

Browse files
committed
Use shortended git hash for version everywhere but in logger
1 parent 35a5b6a commit 408c80c

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

Cargo.lock

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ imageproc = "0.23"
1616
itertools = "0.12"
1717
lazy_static = "1.4.0"
1818
log = "0.4"
19+
png = "0.17.11"
1920
rayon = "1.8.0"
2021
tera = "1.19.1"

build.rs

+2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ fn main() {
55
.output()
66
.expect("Cannot get current commit id");
77
let git_hash = String::from_utf8(output.stdout).unwrap();
8+
let git_hash_short = &git_hash[0..10];
89
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
10+
println!("cargo:rustc-env=GIT_HASH_SHORT={}", git_hash_short);
911
}

src/cli.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use clap::{command, Parser, Subcommand};
44
use rayon::prelude::*;
55

66
#[derive(Parser, Debug)]
7-
#[command(author, version = env!("GIT_HASH"), about)]
7+
#[command(author, version = env!("GIT_HASH_SHORT"), about)]
88
pub struct Cli {
99
#[command(subcommand)]
1010
pub command: Commands,

src/image_handler.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ impl ImageHandler {
293293
}).collect();
294294
if generate_html {
295295
let mut context = Context::new();
296-
context.insert("version", env!("GIT_HASH"));
296+
context.insert("version", env!("GIT_HASH_SHORT"));
297297
let mut palletes: Vec<HashMap<_, _>> = Vec::new();
298298
// TODO: obviously un-hardcode this
299299
let html_file = "output.html";

0 commit comments

Comments
 (0)