authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-04-18 15:32:47 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-04-18 15:32:47 -07:00
logcc5c94aeb57c6a3ffd81b4c9acfe90b1dc9bbbb4
tree588f2282321e631da204c0217e51e0957c7c9218
parent66eeee1ae6caffc37029f16744017bca8409dbe5

remove u.print


4 files changed, 7 insertions(+), 11 deletions(-)

src/cmd/init.zig+1-1
...@@ -69,7 +69,7 @@ pub fn execute(args: [][]u8) !void {...@@ -69,7 +69,7 @@ pub fn execute(args: [][]u8) !void {
69 .lib => try writeLibManifest(w, id, name, entry.?, license, description),69 .lib => try writeLibManifest(w, id, name, entry.?, license, description),
70 }70 }
71 std.debug.print("\n", .{});71 std.debug.print("\n", .{});
72 u.print("Successfully initialized new package {s}!\n", .{name});72 std.debug.print("Successfully initialized new package {s}!\n", .{name});
73 },73 },
74 }74 }
7575
src/common.zig+1-1
...@@ -113,7 +113,7 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) !...@@ -113,7 +113,7 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) !
113 if (!nocache and u.list_contains(options.already_fetched.items, pv)) return pv;113 if (!nocache and u.list_contains(options.already_fetched.items, pv)) return pv;
114114
115 if (options.log and d.type != .local) {115 if (options.log and d.type != .local) {
116 u.print("fetch: {s}: {s}", .{ @tagName(d.type), d.path });116 std.debug.print("fetch: {s}: {s}\n", .{ @tagName(d.type), d.path });
117 }117 }
118 defer {118 defer {
119 if (!bootstrap and options.log and d.type != .local) {119 if (!bootstrap and options.log and d.type != .local) {
src/main.zig+4-4
...@@ -20,16 +20,16 @@ pub fn main() !void {...@@ -20,16 +20,16 @@ pub fn main() !void {
20 const available = if (build_options.bootstrap) zigmod.commands_to_bootstrap else zigmod.commands;20 const available = if (build_options.bootstrap) zigmod.commands_to_bootstrap else zigmod.commands;
2121
22 if (args.len == 0) {22 if (args.len == 0) {
23 u.print("zigmod {s} {s} {s} {s}", .{23 std.debug.print("zigmod {s} {s} {s} {s}\n", .{
24 build_options.version,24 build_options.version,
25 @tagName(builtin.os.tag),25 @tagName(builtin.os.tag),
26 @tagName(builtin.cpu.arch),26 @tagName(builtin.cpu.arch),
27 @tagName(builtin.abi),27 @tagName(builtin.abi),
28 });28 });
29 u.print("", .{});29 std.debug.print("\n", .{});
30 u.print("The commands available are:", .{});30 std.debug.print("The commands available are:\n", .{});
31 inline for (comptime std.meta.declarations(available)) |decl| {31 inline for (comptime std.meta.declarations(available)) |decl| {
32 u.print(" - {s}", .{decl.name});32 std.debug.print(" - {s}\n", .{decl.name});
33 }33 }
34 return;34 return;
35 }35 }
src/util/funcs.zig+1-5
...@@ -11,16 +11,12 @@ pub const kb = b * 1024;...@@ -11,16 +11,12 @@ pub const kb = b * 1024;
11pub const mb = kb * 1024;11pub const mb = kb * 1024;
12pub const gb = mb * 1024;12pub const gb = mb * 1024;
1313
14pub fn print(comptime fmt: string, args: anytype) void {
15 std.debug.print(fmt ++ "\n", args);
16}
17
18const ansi_red = "\x1B[31m";14const ansi_red = "\x1B[31m";
19const ansi_reset = "\x1B[39m";15const ansi_reset = "\x1B[39m";
2016
21pub fn assert(ok: bool, comptime fmt: string, args: anytype) void {17pub fn assert(ok: bool, comptime fmt: string, args: anytype) void {
22 if (!ok) {18 if (!ok) {
23 print(ansi_red ++ fmt ++ ansi_reset, args);19 std.debug.print(ansi_red ++ fmt ++ ansi_reset ++ "\n", args);
24 std.os.exit(1);20 std.os.exit(1);
25 }21 }
26}22}