mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
🎨 Improve upgrade download
This commit is contained in:
parent
f723206423
commit
c6b48882e1
2 changed files with 12 additions and 4 deletions
|
|
@ -131,12 +131,16 @@ func getUpdatePkg() (downloadPkgURLs []string, checksum string, err error) {
|
||||||
}
|
}
|
||||||
pkg := "siyuan-" + ver + "-" + suffix
|
pkg := "siyuan-" + ver + "-" + suffix
|
||||||
|
|
||||||
b3logURL := "https://release.b3log.org/siyuan/" + pkg
|
b3logURL := "https://release.liuyun.io/siyuan/" + pkg
|
||||||
downloadPkgURLs = append(downloadPkgURLs, b3logURL)
|
|
||||||
githubURL := "https://github.com/siyuan-note/siyuan/releases/download/v" + ver + "/" + pkg
|
githubURL := "https://github.com/siyuan-note/siyuan/releases/download/v" + ver + "/" + pkg
|
||||||
ghproxyURL := "https://mirror.ghproxy.com/" + githubURL
|
ghproxyURL := "https://mirror.ghproxy.com/" + githubURL
|
||||||
|
if util.IsChinaCloud() {
|
||||||
|
downloadPkgURLs = append(downloadPkgURLs, b3logURL)
|
||||||
downloadPkgURLs = append(downloadPkgURLs, ghproxyURL)
|
downloadPkgURLs = append(downloadPkgURLs, ghproxyURL)
|
||||||
|
} else {
|
||||||
downloadPkgURLs = append(downloadPkgURLs, githubURL)
|
downloadPkgURLs = append(downloadPkgURLs, githubURL)
|
||||||
|
downloadPkgURLs = append(downloadPkgURLs, b3logURL)
|
||||||
|
}
|
||||||
|
|
||||||
checksums := result["checksums"].(map[string]interface{})
|
checksums := result["checksums"].(map[string]interface{})
|
||||||
checksum = checksums[pkg].(string)
|
checksum = checksums[pkg].(string)
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,10 @@ package util
|
||||||
|
|
||||||
var CurrentCloudRegion = 0
|
var CurrentCloudRegion = 0
|
||||||
|
|
||||||
|
func IsChinaCloud() bool {
|
||||||
|
return 0 == CurrentCloudRegion
|
||||||
|
}
|
||||||
|
|
||||||
func GetCloudServer() string {
|
func GetCloudServer() string {
|
||||||
if 0 == CurrentCloudRegion {
|
if 0 == CurrentCloudRegion {
|
||||||
return chinaServer
|
return chinaServer
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue