|
48 | 48 | > [!NOTE] |
49 | 49 | > Until the next stable release it is recommended to use go-webui's latest development version. |
50 | 50 |
|
51 | | -- ### As Go module |
52 | | - |
53 | | -> [!NOTE] |
54 | | -> Always verify what will be run before using either of these methods. |
55 | | -
|
56 | | - Run this command to get the latest `go-webui` module version, and to sync the WebUI C library that it is using. |
57 | | - |
58 | | - ```sh |
59 | | - go run github.com/webui-dev/go-webui/v2/sync-webui@main |
60 | | - ``` |
61 | | - |
62 | | - Alternatively, use the `setup.sh` or `setup.bat` script to do the same thing. |
63 | | - |
64 | | - - Windows |
| 51 | +The WebUI C library is vendored into this repository at [`v2/webui/`](https://github.com/webui-dev/go-webui/tree/main/v2/webui) as a git subtree, so it ships with the Go module. There is no extra setup step and no submodule to initialize — a plain `go get` is enough. |
65 | 52 |
|
66 | | - ```sh |
67 | | - sh -c "$(curl -fsSL https://raw.githubusercontent.com/webui-dev/go-webui/main/setup.bat)" |
68 | | - ``` |
69 | | - |
70 | | - - Linux / macOS |
| 53 | +- ### As Go module |
71 | 54 |
|
72 | 55 | ```sh |
73 | | - sh -c "$(curl -fsSL https://raw.githubusercontent.com/webui-dev/go-webui/main/setup.sh)" |
| 56 | + go get github.com/webui-dev/go-webui/v2@main |
74 | 57 | ``` |
75 | 58 |
|
76 | | -- ### As submodule |
| 59 | +- ### As git submodule of your project |
77 | 60 |
|
78 | 61 | The instructions below set up go-webui in a `modules` subdirectory of a go project. |
79 | 62 |
|
|
92 | 75 | ``` |
93 | 76 |
|
94 | 77 | ```sh |
95 | | - git submodule update --init --filter=blob:none --recursive |
| 78 | + git submodule update --init --filter=blob:none |
96 | 79 | ``` |
97 | 80 |
|
98 | | - `replace` the path accordingly in the `g.mod` file. |
| 81 | + `replace` the path accordingly in the `go.mod` file. |
99 | 82 |
|
100 | 83 | ``` |
101 | 84 | require github.com/webui-dev/go-webui/v2 v2.5.1 |
102 | 85 |
|
103 | | - replace github.com/webui-dev/go-webui/v2 v2.5.1 => ./modules/go-webui |
| 86 | + replace github.com/webui-dev/go-webui/v2 v2.5.1 => ./modules/go-webui/v2 |
104 | 87 | ``` |
105 | 88 |
|
106 | 89 | - ### As git clone - for development and contribution purposes |
107 | 90 |
|
108 | 91 | The command below retrieves go-webui as a lightweight, filtered clone. |
109 | 92 |
|
110 | 93 | ```sh |
111 | | - git clone --recursive --shallow-submodules --filter=blob:none --also-filter-submodules \ |
112 | | - https://github.com/webui-dev/go-webui.git |
| 94 | + git clone --filter=blob:none https://github.com/webui-dev/go-webui.git |
| 95 | + ``` |
| 96 | + |
| 97 | +- ### Updating the vendored WebUI C library |
| 98 | + |
| 99 | + Maintainers pull the latest WebUI nightly into the subtree with: |
| 100 | + |
| 101 | + ```sh |
| 102 | + git subtree pull --prefix=v2/webui https://github.com/webui-dev/webui.git nightly --squash -m "Update WebUI to nightly" |
113 | 103 | ``` |
114 | 104 |
|
115 | 105 | ## Usage |
|
0 commit comments