authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-03-02 17:14:23 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-03-02 17:14:23 -08:00
logf0ce2a12eb0b54ff59fa7d6ef1ef41e37e5cdc37
tree9eaea245ce2f61ca125174ae1dc73148153a0073
parentf45dbf85435f6fc4557aecf575d0587c498fe20e

collect_deps- make http folow principle 2 better


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

src/common.zig+5-1
...@@ -79,10 +79,14 @@ pub fn collect_deps(dir: []const u8, mpath: []const u8, comptime options: Collec...@@ -79,10 +79,14 @@ pub fn collect_deps(dir: []const u8, mpath: []const u8, comptime options: Collec
79 }79 }
80 const file_name = try u.last(try u.split(d.path, "/"));80 const file_name = try u.last(try u.split(d.path, "/"));
81 if (d.version.len > 0) {81 if (d.version.len > 0) {
82 if (try u.does_folder_exist(pv)) {
83 moddir = pv;
84 break :blk;
85 }
82 const file_path = try std.fs.path.join(gpa, &.{pv, file_name});86 const file_path = try std.fs.path.join(gpa, &.{pv, file_name});
83 try d.type.pull(d.path, pv);87 try d.type.pull(d.path, pv);
84 if (try u.validate_hash(try u.last(try u.split(pv, "/")), file_path)) {88 if (try u.validate_hash(try u.last(try u.split(pv, "/")), file_path)) {
85 try std.fs.deleteFileAbsolute(file_path);89 try std.fs.cwd().deleteFile(file_path);
86 moddir = pv;90 moddir = pv;
87 break :blk;91 break :blk;
88 }92 }