| ... | @@ -23,13 +23,7 @@ pub const ModFile = struct { | ... | @@ -23,13 +23,7 @@ pub const ModFile = struct { |
| 23 | | 23 | |
| 24 | pub fn init(alloc: *std.mem.Allocator, fpath: []const u8) !Self { | 24 | pub fn init(alloc: *std.mem.Allocator, fpath: []const u8) !Self { |
| 25 | // | 25 | // |
| 26 | const mpath = try std.fs.realpathAlloc(alloc, fpath) catch |e| switch (e) { | 26 | const mpath = try std.fs.realpathAlloc(alloc, fpath); |
| 27 | error.FileNotFound => { | | |
| 28 | u.assert(false, "zig.mod file not found in the current directory, run 'zigmod init' to get started.", .{}); | | |
| 29 | unreachable; | | |
| 30 | }, | | |
| 31 | else => e, | | |
| 32 | }; | | |
| 33 | const file = try std.fs.openFileAbsolute(mpath, .{}); | 27 | const file = try std.fs.openFileAbsolute(mpath, .{}); |
| 34 | defer file.close(); | 28 | defer file.close(); |
| 35 | const input = try file.reader().readAllAlloc(alloc, mb); | 29 | const input = try file.reader().readAllAlloc(alloc, mb); |