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>...@@ -52,6 +52,7 @@ zigmod add <type> <path>
5252
53#### Available `fetch` types53#### Available `fetch` types
54- `git`54- `git`
55- `hg`
5556
56### `fetch` command57### `fetch` command
57```58```
src/cmd_fetch.zig+8
...@@ -71,6 +71,14 @@ fn fetch_deps(dir: []const u8, mpath: []const u8) anyerror!u.Module {...@@ -71,6 +71,14 @@ fn fetch_deps(dir: []const u8, mpath: []const u8) anyerror!u.Module {
71 try run_cmd(p, &[_][]const u8{"git", "pull"});71 try run_cmd(p, &[_][]const u8{"git", "pull"});
72 }72 }
73 },73 },
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 },
74 }82 }
75 switch (d.type) {83 switch (d.type) {
76 else => {84 else => {
src/util/dep_type.zig+1
...@@ -7,4 +7,5 @@ const u = @import("index.zig");...@@ -7,4 +7,5 @@ const u = @import("index.zig");
77
8pub const DepType = enum {8pub const DepType = enum {
9 git, // https://git-scm.com/9 git, // https://git-scm.com/
10 hg, // https://www.mercurial-scm.org/
10};11};