| author | |
| committer | |
| log | 0dcee074feee303c4f52b3b93d6353fcd1131744 |
| tree | 4d009e5cc7e057b76d3c548695c807be1c29f24e |
| parent | b69348876ead12b56f862fcb845263daef13dcc6 |
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> |
| 52 | 52 | ||
| 53 | #### Available `fetch` types | 53 | #### Available `fetch` types |
| 54 | - `git` | 54 | - `git` |
| 55 | - `hg` | ||
| 55 | 56 | ||
| 56 | ### `fetch` command | 57 | ### `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"); |
| 7 | 7 | ||
| 8 | pub const DepType = enum { | 8 | pub const DepType = enum { |
| 9 | git, // https://git-scm.com/ | 9 | git, // https://git-scm.com/ |
| 10 | hg, // https://www.mercurial-scm.org/ | ||
| 10 | }; | 11 | }; |