fix: updater source

This commit is contained in:
purocean
2022-01-13 15:06:14 +08:00
parent aeee86f225
commit 6a70f0519b
2 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "yank.note",
"version": "3.20.0",
"version": "3.19.0",
"description": "Yank Note: A hackable markdown note application for programmers",
"main": "dist/main/app.js",
"license": "GPL-3.0",
+16
View File
@@ -35,6 +35,22 @@ const httpRequest = (Provider.prototype as any).httpRequest
return httpRequest.call(this, url, ...args)
}
const getUpdateInfoAndProvider = (autoUpdater as any).getUpdateInfoAndProvider
;(autoUpdater as any).getUpdateInfoAndProvider = async function () {
const result = await getUpdateInfoAndProvider.call(this)
const source: Source = config.get('updater.source', 'github.com')
result.provider.baseUrl.host = source
result.provider.getBaseDownloadPath = function (tag: string, fileName: string) {
const downloadPath = `${this.basePath}/download/${tag}/${fileName}`
if (source === 'mirror.ghproxy.com' || source === 'ghproxy.com') {
return `/https://github.com/${downloadPath}`
}
return downloadPath
}
return result
}
const init = (call: () => void) => {
if (disabled) {
return