Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't break build when git is missing #856

Merged
merged 2 commits into from
Dec 18, 2024
Merged

Conversation

paulgb
Copy link
Member

@paulgb paulgb commented Dec 18, 2024

If git is missing, the build script will fail. This changes it so that it uses the string unknown instead of the version.

This version is currently only used to log a warning if there is a version mismatch between the client and server. We should switch to using only the version number for this soon anyway now that the protocol is more stable.

Copy link

vercel bot commented Dec 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plane ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 18, 2024 8:32pm

@@ -1,13 +1,14 @@
use std::process::Command;

fn main() {
let output = Command::new("git")
let git_hash = Command::new("git")
.args(["rev-parse", "HEAD"])
.output()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unwrap_or_else should be applied to the output method instead of the map method to handle cases where git is not installed.

@paulgb paulgb merged commit db0a709 into main Dec 18, 2024
4 of 5 checks passed
@paulgb paulgb deleted the paulgb/allow-use-as-library branch December 18, 2024 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants