| ... | @@ -29,7 +29,10 @@ pub fn do(dir: std.fs.Dir, pkg_id: []const u8) ![]const u8 { | ... | @@ -29,7 +29,10 @@ pub fn do(dir: std.fs.Dir, pkg_id: []const u8) ![]const u8 { |
| 29 | } | 29 | } |
| 30 | } | 30 | } |
| 31 | | 31 | |
| 32 | const file = try dir.openFile("zig.mod", .{ .read = true, .write = true }); | 32 | const file = dir.openFile("zig.mod", .{ .read = true, .write = true }) catch |err| switch (err) { |
| | 33 | error.FileNotFound => u.fail("error: zig.mod manifest not found! must run from project root.", .{}), |
| | 34 | else => return err, |
| | 35 | }; |
| 33 | defer file.close(); | 36 | defer file.close(); |
| 34 | try file.seekTo(try file.getEndPos()); | 37 | try file.seekTo(try file.getEndPos()); |
| 35 | | 38 | |