authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-17 23:15:47 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-17 23:15:47 -08:00
log0dcee074feee303c4f52b3b93d6353fcd1131744
tree4d009e5cc7e057b76d3c548695c807be1c29f24e
parentb69348876ead12b56f862fcb845263daef13dcc6

add mercurial support


3 files changed, 10 insertions(+), 0 deletions(-)

README.md+1
......@@ -52,6 +52,7 @@ zigmod add <type> <path>
5252
5353#### Available `fetch` types
5454- `git`
55- `hg`
5556
5657### `fetch` command
5758```
src/cmd_fetch.zig+8
......@@ -71,6 +71,14 @@ fn fetch_deps(dir: []const u8, mpath: []const u8) anyerror!u.Module {
7171 try run_cmd(p, &[_][]const u8{"git", "pull"});
7272 }
7373 },
74 .hg => {
75 if (!try u.does_file_exist(p)) {
76 try run_cmd(null, &[_][]const u8{"hg", "clone", d.path, p});
77 }
78 else {
79 try run_cmd(p, &[_][]const u8{"hg", "pull"});
80 }
81 },
7482 }
7583 switch (d.type) {
7684 else => {
src/util/dep_type.zig+1
......@@ -7,4 +7,5 @@ const u = @import("index.zig");
77
88pub const DepType = enum {
99 git, // https://git-scm.com/
10 hg, // https://www.mercurial-scm.org/
1011};