authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-06-05 00:36:11 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-06-05 00:36:11 -07:00
log3a37a1d1bdb22b1e8c2a4c5685ef30c5f25f8dad
tree010b93d353fc43b91c36626d312b3d3a7c2a62bb
parentc1ec64ee6762ee140b46f9dcbf442aba742d4c7f

util/dep_type- assert that fetch and pull commands succeed


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

src/util/dep_type.zig+8-8
......@@ -34,20 +34,20 @@ pub const DepType = enum {
3434 switch (self) {
3535 .system_lib => {},
3636 .git => {
37 _ = try u.run_cmd(null, &.{ "git", "clone", "--recurse-submodules", rpath, dpath });
37 u.assert((try u.run_cmd(null, &.{ "git", "clone", "--recurse-submodules", rpath, dpath })) == 0, "git clone {s} failed", .{rpath});
3838 },
3939 .hg => {
40 _ = try u.run_cmd(null, &.{ "hg", "clone", rpath, dpath });
40 u.assert((try u.run_cmd(null, &.{ "hg", "clone", rpath, dpath })) == 0, "hg clone {s} failed", .{rpath});
4141 },
4242 .http => {
4343 try std.fs.cwd().makePath(dpath);
44 _ = try u.run_cmd(dpath, &.{ "wget", rpath });
44 u.assert((try u.run_cmd(dpath, &.{ "wget", rpath })) == 0, "wget {s} failed", .{rpath});
4545 const f = rpath[std.mem.lastIndexOf(u8, rpath, "/").? + 1 ..];
4646 if (std.mem.endsWith(u8, f, ".zip")) {
47 _ = try u.run_cmd(dpath, &.{ "unzip", f, "-d", "." });
47 u.assert((try u.run_cmd(dpath, &.{ "unzip", f, "-d", "." })) == 0, "unzip {s} failed", .{f});
4848 }
4949 if (std.mem.endsWith(u8, f, ".tar") or std.mem.endsWith(u8, f, ".tar.gz") or std.mem.endsWith(u8, f, ".tar.xz") or std.mem.endsWith(u8, f, ".tar.zst")) {
50 _ = try u.run_cmd(dpath, &.{ "tar", "-xf", f, "-C", "." });
50 u.assert((try u.run_cmd(dpath, &.{ "tar", "-xf", f, "-C", "." })) == 0, "un-tar {s} failed", .{f});
5151 }
5252 },
5353 }
......@@ -57,11 +57,11 @@ pub const DepType = enum {
5757 switch (self) {
5858 .system_lib => {},
5959 .git => {
60 _ = try u.run_cmd(dpath, &.{ "git", "fetch" });
61 _ = try u.run_cmd(dpath, &.{ "git", "pull" });
60 u.assert((try u.run_cmd(dpath, &.{ "git", "fetch" })) == 0, "git fetch failed", .{});
61 u.assert((try u.run_cmd(dpath, &.{ "git", "pull" })) == 0, "git pull failed", .{});
6262 },
6363 .hg => {
64 _ = try u.run_cmd(dpath, &.{ "hg", "pull" });
64 u.assert((try u.run_cmd(dpath, &.{ "hg", "pull" })) == 0, "hg pull failed", .{});
6565 },
6666 .http => {
6767 //