Skip to content

Commit b2cd664

Browse files
committed
refactor: get version info in zigverm from build.zig.zon
1 parent 2eafc21 commit b2cd664

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

build.zig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ pub fn build(b: *std.Build) !void {
2424
zigverm.subsystem = .Console;
2525
zigverm.root_module.addImport("common", common);
2626
zigverm.root_module.addImport("zip", zip.module("zip"));
27+
zigverm.root_module.addAnonymousImport("build.zig.zon", .{
28+
.root_source_file = b.path("build.zig.zon"),
29+
});
2730

2831
const zig = b.addExecutable(.{ .name = "zig", .root_module = b.createModule(.{
2932
.root_source_file = b.path("src/zig/main.zig"),

src/main.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const Release = common.Release;
1717
const install = @import("install.zig");
1818
const Io = std.Io;
1919

20-
pub const Version = "0.7.3";
20+
pub const Version: []const u8 = @import("build.zig.zon").version;
2121

2222
pub fn main() !void {
2323
var aa = std.heap.ArenaAllocator.init(std.heap.page_allocator);

0 commit comments

Comments
 (0)