Skip to content

Commit

Permalink
include commit-hash in version
Browse files Browse the repository at this point in the history
  • Loading branch information
feschber committed Sep 2, 2024
1 parent 9248007 commit 70b11ba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
use std::process::Command;

fn main() {
// commit hash
let git_describe = Command::new("git")
.arg("describe")
.arg("--dirty")
.output()
.unwrap();

let git_describe = String::from_utf8(git_describe.stdout).unwrap();
println!("cargo::rustc-env=GIT_DESCRIBE={git_describe}");

// composite_templates
#[cfg(feature = "gtk")]
glib_build_tools::compile_resources(
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl ConfigToml {
}

#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
#[command(author, version=env!("GIT_DESCRIBE"), about, long_about = None)]
struct CliArgs {
/// the listen port for lan-mouse
#[arg(short, long)]
Expand Down

0 comments on commit 70b11ba

Please sign in to comment.