| ... | @@ -3,6 +3,7 @@ const string = []const u8; | ... | @@ -3,6 +3,7 @@ const string = []const u8; |
| 3 | const gpa = std.heap.c_allocator; | 3 | const gpa = std.heap.c_allocator; |
| 4 | const extras = @import("extras"); | 4 | const extras = @import("extras"); |
| 5 | const git = @import("git"); | 5 | const git = @import("git"); |
| | 6 | const ansi = @import("ansi"); |
| 6 | | 7 | |
| 7 | // | 8 | // |
| 8 | // | 9 | // |
| ... | @@ -12,12 +13,9 @@ pub const kb = b * 1024; | ... | @@ -12,12 +13,9 @@ pub const kb = b * 1024; |
| 12 | pub const mb = kb * 1024; | 13 | pub const mb = kb * 1024; |
| 13 | pub const gb = mb * 1024; | 14 | pub const gb = mb * 1024; |
| 14 | | 15 | |
| 15 | const ansi_red = "\x1B[31m"; | | |
| 16 | const ansi_reset = "\x1B[39m"; | | |
| 17 | | | |
| 18 | pub fn assert(ok: bool, comptime fmt: string, args: anytype) void { | 16 | pub 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 | } |