| author | |
| committer | |
| log | 34a35bbf09436dc3036f66acf49d7180dd8b1215 |
| tree | 63fd0bd301fc386d9300e73556dd922dc3cf04f9 |
| parent | 579e961999dc77531c04deecbe099445de94ce4f |
3 files changed, 2 insertions(+), 16 deletions(-)
src/common.zig+1-1| ... | ... | @@ -102,7 +102,7 @@ fn get_moddir(basedir: []const u8, d: u.Dep, parent_name: []const u8, comptime o |
| 102 | 102 | u.assert(false, "fetch: git: {s}: {s} {s} does not exist", .{ d.path, @tagName(vers.id), vers.string }); |
| 103 | 103 | } |
| 104 | 104 | const td_fd = try fs.cwd().openDir(basedir, .{}); |
| 105 | try u.mkdir_all(pv); | |
| 105 | try fs.cwd().makePath(pv); | |
| 106 | 106 | try td_fd.rename("temp", try d.clean_path_v()); |
| 107 | 107 | if (vers.id != .branch) { |
| 108 | 108 | const pvd = try std.fs.cwd().openDir(pv, .{}); |
src/util/dep_type.zig+1-1| ... | ... | @@ -40,7 +40,7 @@ pub const DepType = enum { |
| 40 | 40 | _ = try u.run_cmd(null, &.{ "hg", "clone", rpath, dpath }); |
| 41 | 41 | }, |
| 42 | 42 | .http => { |
| 43 | try u.mkdir_all(dpath); | |
| 43 | try std.fs.cwd().makePath(dpath); | |
| 44 | 44 | _ = try u.run_cmd(dpath, &.{ "wget", rpath }); |
| 45 | 45 | const f = rpath[std.mem.lastIndexOf(u8, rpath, "/").? + 1 ..]; |
| 46 | 46 | if (std.mem.endsWith(u8, f, ".zip")) { |
src/util/funcs.zig-14| ... | ... | @@ -186,20 +186,6 @@ pub fn last(in: [][]const u8) ![]const u8 { |
| 186 | 186 | return in[in.len - 1]; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | pub fn mkdir_all(dpath: []const u8) anyerror!void { | |
| 190 | if (dpath.len == 0) { | |
| 191 | return; | |
| 192 | } | |
| 193 | const d = if (dpath[dpath.len - 1] == std.fs.path.sep) dpath[0 .. dpath.len - 1] else dpath; | |
| 194 | const ps = std.fs.path.sep_str; | |
| 195 | if (std.mem.lastIndexOf(u8, d, ps)) |index| { | |
| 196 | try mkdir_all(d[0..index]); | |
| 197 | } | |
| 198 | if (!try does_folder_exist(d)) { | |
| 199 | try std.fs.cwd().makeDir(d); | |
| 200 | } | |
| 201 | } | |
| 202 | ||
| 203 | 189 | pub fn rm_recv(path: []const u8) anyerror!void { |
| 204 | 190 | const abs_path = std.fs.realpathAlloc(gpa, path) catch |e| switch (e) { |
| 205 | 191 | error.FileNotFound => return, |