authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-04-18 15:33:21 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-04-18 15:33:21 -07:00
logb6d8d9053373d09caf32873a1a376122c890c274
treec77827562273879f0c4c5c9d6e907467c2e42df3
parentcc5c94aeb57c6a3ffd81b4c9acfe90b1dc9bbbb4

use Witer.writeAll instead of Writer.print when no args


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

src/cmd/fetch.zig+1-1
...@@ -248,7 +248,7 @@ fn print_dirs(w: std.fs.File.Writer, list: []const zigmod.Module) !void {...@@ -248,7 +248,7 @@ fn print_dirs(w: std.fs.File.Writer, list: []const zigmod.Module) !void {
248 for (list) |mod| {248 for (list) |mod| {
249 if (mod.is_sys_lib or mod.is_framework) continue;249 if (mod.is_sys_lib or mod.is_framework) continue;
250 if (std.mem.eql(u8, mod.id, "root")) {250 if (std.mem.eql(u8, mod.id, "root")) {
251 try w.print(" pub const _root = \"\";\n", .{});251 try w.writeAll(" pub const _root = \"\";\n");
252 continue;252 continue;
253 }253 }
254 try w.print(" pub const _{s} = cache ++ \"/{}\";\n", .{ mod.short_id(), std.zig.fmtEscapes(mod.clean_path) });254 try w.print(" pub const _{s} = cache ++ \"/{}\";\n", .{ mod.short_id(), std.zig.fmtEscapes(mod.clean_path) });
src/cmd/init.zig+2-2
...@@ -176,7 +176,7 @@ pub fn writeExeManifest(w: std.fs.File.Writer, id: string, name: string, license...@@ -176,7 +176,7 @@ pub fn writeExeManifest(w: std.fs.File.Writer, id: string, name: string, license
176 try w.print("name: {s}\n", .{name});176 try w.print("name: {s}\n", .{name});
177 if (license) |_| try w.print("license: {s}\n", .{license.?});177 if (license) |_| try w.print("license: {s}\n", .{license.?});
178 if (description) |_| try w.print("description: {s}\n", .{description.?});178 if (description) |_| try w.print("description: {s}\n", .{description.?});
179 try w.print("root_dependencies:\n", .{});179 try w.writeAll("root_dependencies:\n");
180}180}
181181
182pub fn writeLibManifest(w: std.fs.File.Writer, id: string, name: string, entry: string, license: string, description: string) !void {182pub fn writeLibManifest(w: std.fs.File.Writer, id: string, name: string, entry: string, license: string, description: string) !void {
...@@ -185,7 +185,7 @@ pub fn writeLibManifest(w: std.fs.File.Writer, id: string, name: string, entry:...@@ -185,7 +185,7 @@ pub fn writeLibManifest(w: std.fs.File.Writer, id: string, name: string, entry:
185 try w.print("main: {s}\n", .{entry});185 try w.print("main: {s}\n", .{entry});
186 try w.print("license: {s}\n", .{license});186 try w.print("license: {s}\n", .{license});
187 try w.print("description: {s}\n", .{description});187 try w.print("description: {s}\n", .{description});
188 try w.print("dependencies:\n", .{});188 try w.writeAll("dependencies:\n");
189}189}
190190
191fn guessCopyrightName() !?string {191fn guessCopyrightName() !?string {
src/cmd/license.zig+3-3
...@@ -83,7 +83,7 @@ pub fn execute(args: [][]u8) !void {...@@ -83,7 +83,7 @@ pub fn execute(args: [][]u8) !void {
83 try writer.writeAll(ResetIntensity);83 try writer.writeAll(ResetIntensity);
84 for (entry.value_ptr.*.items) |item| {84 for (entry.value_ptr.*.items) |item| {
85 if (std.mem.eql(u8, item.clean_path, "../..")) {85 if (std.mem.eql(u8, item.clean_path, "../..")) {
86 try writer.print("- This\n", .{});86 try writer.writeAll("- This\n");
87 } else {87 } else {
88 try writer.print("- {s} {s}\n", .{ @tagName(item.dep.?.type), item.dep.?.path });88 try writer.print("- {s} {s}\n", .{ @tagName(item.dep.?.type), item.dep.?.path });
89 }89 }
...@@ -91,11 +91,11 @@ pub fn execute(args: [][]u8) !void {...@@ -91,11 +91,11 @@ pub fn execute(args: [][]u8) !void {
91 }91 }
92 if (unspecified_list.items.len > 0) {92 if (unspecified_list.items.len > 0) {
93 try writer.writeAll(Bold);93 try writer.writeAll(Bold);
94 try writer.print("Unspecified:\n", .{});94 try writer.writeAll("Unspecified:\n");
95 try writer.writeAll(ResetIntensity);95 try writer.writeAll(ResetIntensity);
96 for (unspecified_list.items) |item| {96 for (unspecified_list.items) |item| {
97 if (std.mem.eql(u8, item.clean_path, "../..")) {97 if (std.mem.eql(u8, item.clean_path, "../..")) {
98 try writer.print("- This\n", .{});98 try writer.writeAll("- This\n");
99 } else {99 } else {
100 try writer.print("- {s} {s}\n", .{ @tagName(item.dep.?.type), item.dep.?.path });100 try writer.print("- {s} {s}\n", .{ @tagName(item.dep.?.type), item.dep.?.path });
101 }101 }
src/cmd/zpm/add.zig+1-1
...@@ -59,7 +59,7 @@ pub fn execute(args: [][]u8) !void {...@@ -59,7 +59,7 @@ pub fn execute(args: [][]u8) !void {
59 try file.seekTo(try file.getEndPos());59 try file.seekTo(try file.getEndPos());
6060
61 const file_w = file.writer();61 const file_w = file.writer();
62 try file_w.print("\n", .{});62 try file_w.writeAll("\n");
63 try file_w.print(" - src: git {s}\n", .{u.trim_suffix(found.git, ".git")});63 try file_w.print(" - src: git {s}\n", .{u.trim_suffix(found.git, ".git")});
64 if (!(has_zigdotmod or has_zigmodyml)) {64 if (!(has_zigdotmod or has_zigmodyml)) {
65 try file_w.print(" name: {s}\n", .{found.name});65 try file_w.print(" name: {s}\n", .{found.name});