升级
非官方测试版翻译
本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →
配置
Oh My Posh 可以显示可用更新,或在配置中启用后自动更新。
- json
- yaml
- toml
{
"upgrade": {
"notice": true,
"interval": "168h",
"auto": false,
"source": "cdn"
}
}
upgrade:
notice: true
interval: 168h
auto: false
source: cdn
[upgrade]
notice = true
interval = "168h"
auto = false
source = "cdn"
信息
自动升级功能永远不会更新主版本。这是为了避免在用户未明确确认的情况下引入破坏性变更。
警告
当配置中启用了 async 加载功能且你使用的 shell 支持该功能时,升级特性将始终处于禁用状态。
| Name | Type | Default | Description |
|---|---|---|---|
notice | boolean | false | enable displaying the upgrade notice on shell start, only checks based on interval |
auto | boolean | false | automatically update Oh My Posh when an update is found, only checks based on interval |
interval | string | 24h | the duration for which not to check for an update. The duration is a string in the format 1h2m3s and is parsed using the time.ParseDuration function from the Go standard library |
source | string | cdn | where to fetch the information from. Accepted values are cdn (https://cdn.ohmyposh.dev/releases/latest/version.txt) and github (https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/version.txt) |
升级方式
手动升级
你始终可以按照安装部分列出的步骤进行升级,也可以直接使用 upgrade 命令将 Oh My Posh 更新到最新版本。
oh-my-posh upgrade
自动升级
- CLI
- Configuration
oh-my-posh enable upgrade
- json
- yaml
- toml
{
"upgrade": {
"interval": "168h",
"auto": true,
"source": "cdn"
}
}
upgrade:
interval: 168h
auto: true
source: cdn
[upgrade]
interval = "168h"
auto = true
source = "cdn"