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 {...@@ -91,7 +91,7 @@ fn fetch_deps(dir: []const u8, mpath: []const u8) anyerror!u.Module {
91 }91 }
92 _ = try run_cmd(null, &[_][]const u8{"git", "clone", d.path, pv});92 _ = try run_cmd(null, &[_][]const u8{"git", "clone", d.path, pv});
93 _ = try run_cmd(pv, &[_][]const u8{"git", "checkout", ref});93 _ = 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);
95 try pvd.deleteTree(".git");95 try pvd.deleteTree(".git");
96 moddir = pv;96 moddir = pv;
97 }97 }
src/util/funcs.zig+6
...@@ -115,3 +115,9 @@ pub fn list_contains(haystack: *std.ArrayList([]const u8), needle: []const u8) b...@@ -115,3 +115,9 @@ pub fn list_contains(haystack: *std.ArrayList([]const u8), needle: []const u8) b
115 }115 }
116 return false;116 return false;
117}117}
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}