authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-20 14:36:10 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-20 14:36:10 -08:00
loga53fd2f725c29ab5e5de65d300dee48d22bfe023
treeace9c582d066f823d88212e4873d79435fbd4db5
parent73af129674c57d49efa4a19eec523bd36079bcec

std.fs.openDirAbsolute was added after 0.7.0


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

src/cmd_fetch.zig+1-1
......@@ -91,7 +91,7 @@ fn fetch_deps(dir: []const u8, mpath: []const u8) anyerror!u.Module {
9191 }
9292 _ = try run_cmd(null, &[_][]const u8{"git", "clone", d.path, pv});
9393 _ = try run_cmd(pv, &[_][]const u8{"git", "checkout", ref});
94 const pvd = try std.fs.openDirAbsolute(pv, .{});
94 const pvd = try u.open_dir_absolute(pv);
9595 try pvd.deleteTree(".git");
9696 moddir = pv;
9797 }
src/util/funcs.zig+6
......@@ -115,3 +115,9 @@ pub fn list_contains(haystack: *std.ArrayList([]const u8), needle: []const u8) b
115115 }
116116 return false;
117117}
118
119pub fn open_dir_absolute(dpath: []const u8) !std.fs.Dir {
120 return std.fs.Dir{
121 .fd = (try std.fs.openFileAbsolute(dpath, .{})).handle,
122 };
123}