From 7d51a39cef69942e454871a575e9dade92ecc4f4 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Thu, 27 Jan 2022 04:37:20 -0800 Subject: [PATCH] don't crash if a project doesn't have a zigmod.lock --- src/common.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common.zig b/src/common.zig index 476f542b8a27738ef514a3ac5276c1bd2edfe34e..8b0eb115c4afa00bb67d60f6dd5107ac705c3393 100644 --- a/src/common.zig +++ b/src/common.zig @@ -361,6 +361,7 @@ pub fn add_files_package(alloc: std.mem.Allocator, cachepath: string, pkg_name: pub fn parse_lockfile(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const [4]string { var list = std.ArrayList([4]string).init(alloc); const max = std.math.maxInt(usize); + if (!try u.does_file_exist(dir, "zigmod.lock")) return &[_][4]string{}; const f = try dir.openFile("zigmod.lock", .{}); const r = f.reader(); var i: usize = 0; -- 2.54.0