authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-01-27 04:37:20 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-01-27 04:37:20 -08:00
log7d51a39cef69942e454871a575e9dade92ecc4f4
treed3a3a00bd88d66d4e812597b7d7ef06a4e6d7b65
parent98b9d5748b34d780e3e5e0b3d6a3492b7c618cd6

don't crash if a project doesn't have a zigmod.lock


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

src/common.zig+1
...@@ -361,6 +361,7 @@ pub fn add_files_package(alloc: std.mem.Allocator, cachepath: string, pkg_name:...@@ -361,6 +361,7 @@ pub fn add_files_package(alloc: std.mem.Allocator, cachepath: string, pkg_name:
361pub fn parse_lockfile(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const [4]string {361pub fn parse_lockfile(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const [4]string {
362 var list = std.ArrayList([4]string).init(alloc);362 var list = std.ArrayList([4]string).init(alloc);
363 const max = std.math.maxInt(usize);363 const max = std.math.maxInt(usize);
364 if (!try u.does_file_exist(dir, "zigmod.lock")) return &[_][4]string{};
364 const f = try dir.openFile("zigmod.lock", .{});365 const f = try dir.openFile("zigmod.lock", .{});
365 const r = f.reader();366 const r = f.reader();
366 var i: usize = 0;367 var i: usize = 0;