mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 17:26:09 +03:00
Merge pull request #2226 from ghostty-org/push-mtvnlywtrwsk
build: support building without .git directory
This commit is contained in:
@ -179,7 +179,9 @@ pub fn build(b: *std.Build) !void {
|
|||||||
else version: {
|
else version: {
|
||||||
const vsn = Version.detect(b) catch |err| switch (err) {
|
const vsn = Version.detect(b) catch |err| switch (err) {
|
||||||
// If Git isn't available we just make an unknown dev version.
|
// 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,
|
.major = app_version.major,
|
||||||
.minor = app_version.minor,
|
.minor = app_version.minor,
|
||||||
.patch = app_version.patch,
|
.patch = app_version.patch,
|
||||||
|
@ -25,6 +25,7 @@ pub fn detect(b: *std.Build) !Version {
|
|||||||
.Ignore,
|
.Ignore,
|
||||||
) catch |err| switch (err) {
|
) catch |err| switch (err) {
|
||||||
error.FileNotFound => return error.GitNotFound,
|
error.FileNotFound => return error.GitNotFound,
|
||||||
|
error.ExitCodeFailure => return error.GitNotRepository,
|
||||||
else => return err,
|
else => return err,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user