mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 04:58:11 +08:00
Fix commit branch when not in pull request
This commit is contained in:
+3
-4
@@ -17,9 +17,8 @@ fn main() {
|
|||||||
// They are accessed with the `env!("...")` macro in the codebase.
|
// They are accessed with the `env!("...")` macro in the codebase.
|
||||||
println!("cargo:rustc-env=GRAPHITE_GIT_COMMIT_DATE={}", git_command(&["log", "-1", "--format=%cd"]));
|
println!("cargo:rustc-env=GRAPHITE_GIT_COMMIT_DATE={}", git_command(&["log", "-1", "--format=%cd"]));
|
||||||
println!("cargo:rustc-env=GRAPHITE_GIT_COMMIT_HASH={}", git_command(&["rev-parse", "HEAD"]));
|
println!("cargo:rustc-env=GRAPHITE_GIT_COMMIT_HASH={}", git_command(&["rev-parse", "HEAD"]));
|
||||||
println!(
|
let branch = std::env::var("GITHUB_HEAD_REF").unwrap_or_default();
|
||||||
"cargo:rustc-env=GRAPHITE_GIT_COMMIT_BRANCH={}",
|
let branch = if branch.is_empty() { git_command(&["name-rev", "--name-only", "HEAD"]) } else { branch };
|
||||||
std::env::var("GITHUB_HEAD_REF").unwrap_or_else(|_| git_command(&["name-rev", "--name-only", "HEAD"]))
|
println!("cargo:rustc-env=GRAPHITE_GIT_COMMIT_BRANCH={}", branch);
|
||||||
);
|
|
||||||
println!("cargo:rustc-env=GRAPHITE_RELEASE_SERIES={}", GRAPHITE_RELEASE_SERIES);
|
println!("cargo:rustc-env=GRAPHITE_RELEASE_SERIES={}", GRAPHITE_RELEASE_SERIES);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user