authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-09 14:54:13 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-09 14:54:13 -08:00
logdc237909b513307daadee1f049bac8d350624115
tree5dcebf33a2852276df9fef1e9e41a2ef04113b57
parentf25484ef2c04b08a4c4b17300b7818d22ea48a4d

Create README.md


1 files changed, 80 insertions(+), 0 deletions(-)

README.md created+80
......@@ -0,0 +1,80 @@
1# zigmod
2![loc](https://sloc.xyz/github/nektro/zigmod)
3[![license](https://img.shields.io/github/license/nektro/zigmod.svg)](https://github.com/nektro/zigmod/blob/master/LICENSE)
4[![discord](https://img.shields.io/discord/551971034593755159.svg?logo=discord)](https://discord.gg/P6Y4zQC)
5[![circleci](https://circleci.com/gh/nektro/zigmod.svg?style=svg)](https://circleci.com/gh/nektro/zigmod)
6[![release](https://img.shields.io/github/v/release/nektro/zigmod)](https://github.com/nektro/zigmod/releases/latest)
7[![goreportcard](https://goreportcard.com/badge/github.com/nektro/zigmod)](https://goreportcard.com/report/github.com/nektro/zigmod)
8[![codefactor](https://www.codefactor.io/repository/github/nektro/zigmod/badge)](https://www.codefactor.io/repository/github/nektro/zigmod)
9[![downloads](https://img.shields.io/github/downloads/nektro/zigmod/total.svg)](https://github.com/nektro/zigmod/releases)
10
11A package manager for the Zig programming language.
12
13Zig
14- https://ziglang.org/
15- https://github.com/ziglang/zig
16- https://github.com/ziglang/zig/wiki/Community
17
18## Download
19Releases
20- https://github.com/nektro/zigmod/releases
21
22Source
23- `git clone https://github.com/nektro/zigmod.git`
24- https://github.com/nektro/zigmod/archive/master.zip
25
26## Usage
27
28### `init` command
29```
30zigmod init [name] [entry_file]
31```
32
33- `[name]` defaults to the name of the folder you run the program in. It will also remove `zig-` from the start of the directory name by default if is prefixed by that.
34- `[entry_file]` defaults to `src/main.zig`
35- This command will create a `zig.mod` file in the root of your project. It is in yaml syntax.
36
37### `add` command
38```
39zigmod add <type> <path>
40```
41
42- `<type>` is the type of package we're adding. Currently `git` is the only valid type. More to come.
43- `<path>` is the URL to the package you'd like to include.
44
45### `fetch` command
46```
47zigmod fetch
48```
49
50- This command takes no parameters and will generate a `deps.zig` in the root of your project.
51- `deps.zig` should not be checked into your source control.
52
53### `deps.zig`
54```diff
55const Builder = @import("std").build.Builder;
56+const deps = @import("./deps.zig");
57
58pub fn build(b: *Builder) void {
59 const target = b.standardTargetOptions(.{});
60
61 const mode = b.standardReleaseOptions();
62
63 const exe = b.addExecutable("zigmod", "src/main.zig");
64 exe.setTarget(target);
65 exe.setBuildMode(mode);
66+ for (deps.packages) |pkg| {
67+ exe.addPackage(pkg);
68+ }
69 for (deps.system_libs) |lib| {
70 exe.linkSystemLibrary(lib);
71 }
72 exe.install();
73```
74
75## Contact
76- hello@nektro.net
77- https://twitter.com/nektro
78
79## License
80MIT