mirror of
https://github.com/gopher64/gopher64.git
synced 2026-07-11 01:25:20 +02:00
fix git version with shallow clones (#794)
* fix git version with shallow clones * more
This commit is contained in:
Generated
+1
-1
@@ -2102,7 +2102,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gopher64"
|
||||
version = "1.1.17"
|
||||
version = "1.1.16"
|
||||
dependencies = [
|
||||
"bindgen",
|
||||
"cc",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "gopher64"
|
||||
version = "1.1.17"
|
||||
version = "1.1.16"
|
||||
edition = "2024"
|
||||
rust-version = "1.95.0"
|
||||
|
||||
|
||||
@@ -277,12 +277,24 @@ fn main() {
|
||||
.compile("simd");
|
||||
}
|
||||
|
||||
let git_output = std::process::Command::new("git")
|
||||
.args(["describe", "--always", "--dirty"])
|
||||
.output()
|
||||
.unwrap();
|
||||
let mut git_output = std::process::Command::new("git");
|
||||
git_output.args(["describe", "--dirty"]);
|
||||
|
||||
let git_describe = String::from_utf8(git_output.stdout).unwrap();
|
||||
let git_describe = if let Ok(git_output) = git_output.output()
|
||||
&& git_output.status.success()
|
||||
{
|
||||
String::from_utf8(git_output.stdout).unwrap()
|
||||
} else if let Ok(git_output) = git_output.args(["--always"]).output()
|
||||
&& git_output.status.success()
|
||||
{
|
||||
format!(
|
||||
"v{}-{}",
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
String::from_utf8(git_output.stdout).unwrap()
|
||||
)
|
||||
} else {
|
||||
panic!("Failed to get git describe");
|
||||
};
|
||||
println!("cargo:rustc-env=GIT_DESCRIBE={git_describe}");
|
||||
|
||||
println!("cargo:rerun-if-env-changed=NETPLAY_ID");
|
||||
|
||||
Reference in New Issue
Block a user