feat: commit hash in banner, version command, file upload/download
This commit is contained in:
parent
cb86894369
commit
f7d29a98d3
8 changed files with 202 additions and 9 deletions
11
crates/server/build.rs
Normal file
11
crates/server/build.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fn main() {
|
||||
let hash = std::process::Command::new("git")
|
||||
.args(["rev-parse", "--short", "HEAD"])
|
||||
.output()
|
||||
.ok()
|
||||
.and_then(|o| String::from_utf8(o.stdout).ok())
|
||||
.unwrap_or_default();
|
||||
let hash = hash.trim();
|
||||
println!("cargo:rustc-env=GIT_COMMIT={}", if hash.is_empty() { "unknown" } else { hash });
|
||||
println!("cargo:rerun-if-changed=.git/HEAD");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue