From 08155b63267ccc528e4e9c8660aa17913d49cee1 Mon Sep 17 00:00:00 2001 From: Meghan Date: Fri, 20 Nov 2020 13:07:05 -0800 Subject: [PATCH] fetch/git: if version'd dir exists, skip download --- src/cmd_fetch.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cmd_fetch.zig b/src/cmd_fetch.zig index a006076c262766b36db665fe40298f04da373f3b..19e9e20a3fdeab2d8ce746987a03250b133c26b1 100644 --- a/src/cmd_fetch.zig +++ b/src/cmd_fetch.zig @@ -67,7 +67,10 @@ fn fetch_deps(dir: []const u8, mpath: []const u8) anyerror!u.Module { const pv = try u.concat(&[_][]const u8{dir, "/v/", try d.clean_path(), "/", d.version}); u.print("fetch: {}: {}: {}", .{m.name, @tagName(d.type), d.path}); switch (d.type) { - .git => { + .git => blk: { + if (try u.does_file_exist(pv)) { + break :blk; + } if (!try u.does_file_exist(p)) { _ = try run_cmd(null, &[_][]const u8{"git", "clone", d.path, p}); } -- 2.54.0