mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-18 09:59:31 +08:00
56 lines
1.8 KiB
Plaintext
56 lines
1.8 KiB
Plaintext
# 本地开发
|
||
|
||
## 概述
|
||
|
||
Wails 一直在开发中,新版本会定期“标记”。 这通常发生在 `master` 分支上所有较新的代码都经过测试并确认有效时。 如果您需要尚未发布的错误修复或功能,可以通过以下步骤使用最新的“前沿风险”版本:
|
||
|
||
- `git clone https://github.com/wailsapp/wails`
|
||
- `cd wails/v2/cmd/wails`
|
||
- `go install`
|
||
|
||
注意:您将项目克隆到的目录现在将被称为“clonedir”。
|
||
|
||
现在,Wails CLI 将是最新版本。
|
||
|
||
### 更新您的项目
|
||
|
||
要更新项目以使用最新版本的 Wails 库,请更新项目 `go.mod` 并确保以下行位于文件底部:
|
||
|
||
`replace github.com/wailsapp/wails/v2 => <clonedir>`
|
||
|
||
示例:
|
||
|
||
在 Windows 上:`replace github.com/wailsapp/wails/v2 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2`
|
||
|
||
在'nix 上:`replace github.com/wailsapp/wails/v2 => /home/me/projects/wails/v2`
|
||
|
||
要恢复到稳定版本,请运行:
|
||
|
||
`go install github.com/wailsapp/wails/v2/cmd/wails@latest`
|
||
|
||
## 测试一个分支
|
||
|
||
如果要测试一个分支,请按照上面的说明进行操作,但请确保在安装之前切换要测试的分支:
|
||
|
||
- `git clone https://github.com/wailsapp/wails`
|
||
- `cd wails`
|
||
- `git checkout -b branch-to-test --track origin/branch-to-test`
|
||
- `cd v2/cmd/wails`
|
||
- `go install`
|
||
|
||
确保如上所述 [更新您的项目](#更新您的项目)。
|
||
|
||
## 测试 PR
|
||
|
||
如果您想测试 PR,请按照上面的说明进行操作,但请确保在安装前获取 PR 并切换分支。 请替换 `[IDofThePR]` 为 github.com 上显示的 PR 的 ID:
|
||
|
||
- `git clone https://github.com/wailsapp/wails`
|
||
- `cd wails`
|
||
- `git fetch -u origin pull/[IDofThePR]/head:test/pr-[IDofThePR]`
|
||
- `git checkout test/pr-[IDofThePR]`
|
||
- `git reset --hard HEAD`
|
||
- `cd v2/cmd/wails`
|
||
- `go install`
|
||
|
||
确保如上所述 [更新您的项目](#更新您的项目)。
|