mirror of
https://github.com/purocean/yn.git
synced 2026-10-16 07:26:07 +08:00
fix: updater source
This commit is contained in:
+1
-1
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user