authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-05-28 02:18:38 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-05-28 02:18:38 -07:00
log25f39752b3c11fd447eeedbd674db158d5932e72
tree18ee4642ae86546f9892cc42d4744be2b35b65f6
parent977e866a33dd4829eec3c5862eb23ff954ba31ab

funcs: no need to hardcode this when we depend on ansi


1 files changed, 2 insertions(+), 4 deletions(-)

src/util/funcs.zig+2-4
...@@ -3,6 +3,7 @@ const string = []const u8;...@@ -3,6 +3,7 @@ const string = []const u8;
3const gpa = std.heap.c_allocator;3const gpa = std.heap.c_allocator;
4const extras = @import("extras");4const extras = @import("extras");
5const git = @import("git");5const git = @import("git");
6const ansi = @import("ansi");
67
7//8//
8//9//
...@@ -12,12 +13,9 @@ pub const kb = b * 1024;...@@ -12,12 +13,9 @@ pub const kb = b * 1024;
12pub const mb = kb * 1024;13pub const mb = kb * 1024;
13pub const gb = mb * 1024;14pub const gb = mb * 1024;
1415
15const ansi_red = "\x1B[31m";
16const ansi_reset = "\x1B[39m";
17
18pub fn assert(ok: bool, comptime fmt: string, args: anytype) void {16pub fn assert(ok: bool, comptime fmt: string, args: anytype) void {
19 if (!ok) {17 if (!ok) {
20 std.debug.print(ansi_red ++ fmt ++ ansi_reset ++ "\n", args);18 std.debug.print(ansi.color.Fg(.Red, fmt) ++ "\n", args);
21 std.process.exit(1);19 std.process.exit(1);
22 }20 }
23}21}