authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-06-05 20:39:56 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-06-05 20:39:56 -07:00
log0a970854c1f5c8c11b6ab3ec50328ab8ec137fe5
tree2d84c46decf62420f2cacdf0b1a04836bb0a3f9f
parent6680b93989318cf36c98eadbb1e86452bfc6bb11

inline ansi red foreground code and remove `libs/zig-ansi` submodule


6 files changed, 6 insertions(+), 15 deletions(-)

.gitmodules-3
......@@ -1,6 +1,3 @@
11[submodule "libs/yaml"]
22 path = libs/yaml
33 url = https://github.com/yaml/libyaml
4[submodule "libs/zig-ansi"]
5 path = libs/zig-ansi
6 url = https://github.com/nektro/zig-ansi
build.zig-1
......@@ -41,7 +41,6 @@ pub fn build(b: *Builder) void {
4141 exe.addCSourceFile("./libs/yaml/src/writer.c", &.{});
4242
4343 exe.addPackagePath("zigmod", "./src/lib.zig");
44 exe.addPackagePath("ansi", "./libs/zig-ansi/src/lib.zig");
4544 } else {
4645 deps.addAllTo(exe);
4746 }
deps.zig-2
......@@ -71,12 +71,10 @@ pub const package_data = struct {
7171
7272pub const packages = &[_]std.build.Pkg{
7373 package_data._89ujp8gq842x,
74 package_data._s84v9o48ucb0,
7574};
7675
7776pub const pkgs = struct {
7877 pub const zigmod = packages[0];
79 pub const ansi = packages[1];
8078};
8179
8280pub const c_include_dirs = &[_][]const u8{
libs/zig-ansi deleted-1
......@@ -1 +0,0 @@
1Subproject commit 876c32c42044a5e1554f4662b4b9bdfad7ee5086
src/util/funcs.zig+4-3
......@@ -1,8 +1,6 @@
11const std = @import("std");
22const gpa = std.heap.c_allocator;
33
4const ansi = @import("ansi");
5
64const u = @import("index.zig");
75
86//
......@@ -17,9 +15,12 @@ pub fn print(comptime fmt: []const u8, args: anytype) void {
1715 std.debug.print(fmt ++ "\n", args);
1816}
1917
18const ansi_red = "\x1B[31m";
19const ansi_reset = "\x1B[39m";
20
2021pub fn assert(ok: bool, comptime fmt: []const u8, args: anytype) void {
2122 if (!ok) {
22 print(comptime ansi.color.Fg(.Red, "error: " ++ fmt), args);
23 print(ansi_red ++ fmt ++ ansi_reset, args);
2324 std.os.exit(1);
2425 }
2526}
zig.mod+2-5
......@@ -25,12 +25,12 @@ dependencies:
2525 - src/scanner.c
2626 - src/writer.c
2727
28 - src: git https://github.com/nektro/zig-ansi
29
3028 # Entries above this line are needed to bootstrap and kept as git submodules
3129 # --------
3230 # Entries below this line are only fetched with zigmod itself
3331
32 - src: git https://github.com/nektro/zig-ansi
33
3434 - src: git https://github.com/ziglibs/known-folders
3535
3636 - src: git https://github.com/nektro/zig-licenses
......@@ -40,6 +40,3 @@ dependencies:
4040 - src: git https://github.com/nektro/zig-json
4141
4242 - src: http https://aquila.red/1/nektro/range/v0.1.tar.gz sha256-d2f72fdd8cdb8 0 1
43
44dev_dependencies:
45 - src: git https://github.com/nektro/zig-ansi