| ... | ... | @@ -143,7 +143,7 @@ pub fn execute(self_name: []const u8, args: []const [:0]const u8) !void { |
| 143 | 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 | 144 | if (do) { |
| 145 | 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 | 147 | defer file.close(); |
| 148 | 148 | const len = try file.getEndPos(); |
| 149 | 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 | 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 | 166 | if (do) { |
| 167 | 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 | 169 | defer file.close(); |
| 170 | 170 | const len = try file.getEndPos(); |
| 171 | 171 | if (len > 0) try file.seekTo(len - 1); |