authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-09-01 16:01:20-07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-09-01 16:01:20-07:00
log441e0461738ff9b64fe58e0ab7fd7c955a43a525
treea58a9352ab816bb7c43c4ef0a4265260086c22b3
parentc2a58ca4e84674ce29f31d2550b43f5e5a562cfa
signature Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

cmd/init: tidy


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

src/cmd/init.zig+2-2
...@@ -143,7 +143,7 @@ pub fn execute(self_name: []const u8, args: []const [:0]const u8) !void {...@@ -143,7 +143,7 @@ pub fn execute(self_name: []const u8, args: []const [:0]const u8) !void {
143 const do = try inquirer.forConfirm(stdout, stdin, "It appears you're using git. Do you want init to add Zigmod to your .gitignore?", gpa);143 const do = try inquirer.forConfirm(stdout, stdin, "It appears you're using git. Do you want init to add Zigmod to your .gitignore?", gpa);
144 if (do) {144 if (do) {
145 const exists = try nfs.cwd().exists(".gitignore");145 const exists = try nfs.cwd().exists(".gitignore");
146 const file: nfs.File = try (if (exists) cwd.openFile(".gitignore", .{ .mode = .read_write }) else cwd.createFile(".gitignore", .{}));146 const file = try cwd.createFile(".gitignore", .{ .truncate = false });
147 defer file.close();147 defer file.close();
148 const len = try file.getEndPos();148 const len = try file.getEndPos();
149 if (len > 0) try file.seekTo(len - 1);149 if (len > 0) try file.seekTo(len - 1);
...@@ -165,7 +165,7 @@ pub fn execute(self_name: []const u8, args: []const [:0]const u8) !void {...@@ -165,7 +165,7 @@ pub fn execute(self_name: []const u8, args: []const [:0]const u8) !void {
165 const do = try inquirer.forConfirm(stdout, stdin, "It appears you're using git. Do you want init to add Zigmod to your .gitattributes?", gpa);165 const do = try inquirer.forConfirm(stdout, stdin, "It appears you're using git. Do you want init to add Zigmod to your .gitattributes?", gpa);
166 if (do) {166 if (do) {
167 const exists = try nfs.cwd().exists(".gitattributes");167 const exists = try nfs.cwd().exists(".gitattributes");
168 const file: nfs.File = try (if (exists) cwd.openFile(".gitattributes", .{ .mode = .read_write }) else cwd.createFile(".gitattributes", .{}));168 const file = try cwd.createFile(".gitattributes", .{ .truncate = false });
169 defer file.close();169 defer file.close();
170 const len = try file.getEndPos();170 const len = try file.getEndPos();
171 if (len > 0) try file.seekTo(len - 1);171 if (len > 0) try file.seekTo(len - 1);