authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-29 05:39:20 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-29 05:39:20 -08:00
logc46ba2b2421043f61b7eccce131aa4b1fc75d264
tree176fdda65a9f78290bfa8decece4442c7a750390
parent6702a167ca92115c93204a885403e53122770e4c

revert modfile init catch


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

src/util/modfile.zig+1-7
...@@ -23,13 +23,7 @@ pub const ModFile = struct {...@@ -23,13 +23,7 @@ pub const ModFile = struct {
2323
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);