Merge pull request #2226 from ghostty-org/push-mtvnlywtrwsk

build: support building without .git directory
This commit is contained in:
Mitchell Hashimoto
2024-09-12 09:40:15 -07:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

View File

@ -179,7 +179,9 @@ pub fn build(b: *std.Build) !void {
else version: {
const vsn = Version.detect(b) catch |err| switch (err) {
// If Git isn't available we just make an unknown dev version.
error.GitNotFound => break :version .{
error.GitNotFound,
error.GitNotRepository,
=> break :version .{
.major = app_version.major,
.minor = app_version.minor,
.patch = app_version.patch,

View File

@ -25,6 +25,7 @@ pub fn detect(b: *std.Build) !Version {
.Ignore,
) catch |err| switch (err) {
error.FileNotFound => return error.GitNotFound,
error.ExitCodeFailure => return error.GitNotRepository,
else => return err,
};