Skip to content

Commit f6b3fe3

Browse files
committed
polish docs
1 parent 962e9a2 commit f6b3fe3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/content/programs/zigfetch.org

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
#+TITLE: zigfetch
22
#+DATE: 2025-01-01T18:01:47+0800
3-
#+LASTMOD: 2025-01-04T17:16:15+0800
3+
#+LASTMOD: 2025-02-25T22:44:10+0800
44
#+TYPE: docs
55
#+DESCRIPTION: Fetch zig packages, utilizing libcurl.
66

77
=zigfetch= behaves similarly to =zig fetch=, but utilizing the capabilities of libcurl for its functionality.
88

9-
HTTP support within Zig's standard library isn't currently stable, [[https://github.com/ziglang/zig/issues/21792][this proxy issue]] make it even harder, resulting in multiple errors occurring during dependency downloads when building Zig projects.
9+
HTTP support within Zig's standard library isn't currently stable, [[https://github.com/ziglang/zig/issues/21792][this proxy issue]] make it even harder, resulting in multiple errors occurring during dependency downloads when building Zig projects. This poses a significant challenge for Chinese developers owing to [[https://en.wikipedia.org/wiki/Great_Firewall][the Great Firewall]].
1010

1111
{{< figure src="https://fs.liujiacai.net/cdn-img/zigcli/zig-fetch-errors.webp" >}}
1212

13-
This poses a significant challenge for Chinese developers owing to [[https://en.wikipedia.org/wiki/Great_Firewall][the Great Firewall]].
14-
15-
As a consequence, =zigfetch= was developed; this tool operates via libcurl to ensure that both the =http_proxy= and =https_proxy= environment variables function correctly.
16-
17-
- https://curl.se/libcurl/c/libcurl-env.html
13+
As a consequence, =zigfetch= was developed. It operates via libcurl to ensure that both the =http_proxy= and =https_proxy= [[https://curl.se/libcurl/c/libcurl-env.html][environment variables]] function correctly.
1814

15+
** Usage
1916
#+begin_src bash :results verbatim :exports result :dir ../../..
2017
./zig-out/bin/zigfetch --help
2118
#+end_src
@@ -34,9 +31,12 @@ As a consequence, =zigfetch= was developed; this tool operates via libcurl to en
3431
-d, --debug-hash Print hash for each file
3532
#+end_example
3633

34+
If the argument is a local directory, =zigfetch= will attempt to open =build.zig.zon=, download dependencies specified in the =.dependencies= fields, and then calculate hashes for each package. If these hashes match those in the =.hash= fields, =zigfetch= will move them to =~/.cache/zig/p/{hash}= after completion.
3735

38-
This is a demo for socks5 proxy setup:
36+
If =zigfetch= succeeds, =zig build= will build the project directly, assuming the dependencies already exist.
3937

38+
** Proxy config
39+
This is a demo for socks5 proxy setup:
4040
#+begin_src bash
4141
export http_proxy="socks5://127.0.0.1:1080"
4242
export https_proxy=$http_proxy

0 commit comments

Comments
 (0)