🔧 迁移到 git.garfieldho.me/moon-source
Co-authored-by: Copilot <[email protected]>
This commit is contained in:
1 parent
6b5693a3d7
commit
e51460a8d0
5 files changed
+31
-31
No files matched your search
+4
-4
@@ -1,10 +1,10 @@
|
||||
--[[--
|
||||
书源插件在线更新(Codeberg Release)。
|
||||
书源插件在线更新(Forgejo Release)。
|
||||
|
||||
本文件是 moonsource-template 仓库 common/update.lua 的副本,由 tools/sync.sh 同步到每个插件仓库的
|
||||
<包名>/update.lua,请改模板仓库,不要手改副本。
|
||||
|
||||
每个插件在自己的仓库(GarfieldMoon/moonsource-<名字>)独立发版,只检查并更新它自己:
|
||||
每个插件在自己的仓库(moon-source/moonsource-<名字>)独立发版,只检查并更新它自己:
|
||||
仓库名和目录名都由包名(require 时的模块名)推出,包体校验值取自同一 Release 的 SHA256SUMS。
|
||||
|
||||
@module moonsource.update
|
||||
@@ -13,8 +13,8 @@
|
||||
local PKG = (...):match("^(.-)%.update$")
|
||||
local NAME = PKG:gsub("_", "-")
|
||||
local DIR = NAME .. ".koplugin"
|
||||
local REPO = "GarfieldMoon/" .. NAME
|
||||
local SITE = "https://codeberg.org"
|
||||
local REPO = "moon-source/" .. NAME
|
||||
local SITE = "https://git.garfieldho.me"
|
||||
local API = SITE .. "/api/v1/repos/" .. REPO .. "/releases/latest"
|
||||
local CHECK_INTERVAL = 24 * 60 * 60
|
||||
local MAX_ARCHIVE_BYTES = 50 * 1024 * 1024
|
||||
|
||||
@@ -7,7 +7,7 @@ local Json = require("support.json_stub")
|
||||
|
||||
local PKG = "@PKG@"
|
||||
local DIR = "@DIR@"
|
||||
local REPO = "GarfieldMoon/" .. DIR:gsub("%.koplugin$", "")
|
||||
local REPO = "moon-source/" .. DIR:gsub("%.koplugin$", "")
|
||||
|
||||
local cfg = {}
|
||||
package.preload["utils.settings"] = function()
|
||||
@@ -18,7 +18,7 @@ package.preload["utils.text"] = function()
|
||||
end
|
||||
package.preload["http.timeout"] = function() return { net = function() return 5 end } end
|
||||
|
||||
local BASE = "https://codeberg.org/" .. REPO .. "/releases/download/v1.2.3/"
|
||||
local BASE = "https://git.garfieldho.me/" .. REPO .. "/releases/download/v1.2.3/"
|
||||
local zip = DIR .. "-1.2.3.zip"
|
||||
local other = "moonsource-other.koplugin-1.2.3.zip"
|
||||
local release = {
|
||||
@@ -54,7 +54,7 @@ Assert.is_true(Update.newer("0.0.1", "0.0.0-dev"))
|
||||
local got, err
|
||||
Update.check(function(r, e) got, err = r, e end)
|
||||
Assert.is_nil(err)
|
||||
Assert.eq(requested[1], "https://codeberg.org/api/v1/repos/" .. REPO .. "/releases/latest")
|
||||
Assert.eq(requested[1], "https://git.garfieldho.me/api/v1/repos/" .. REPO .. "/releases/latest")
|
||||
Assert.eq(got.version, "1.2.3")
|
||||
Assert.eq(got.notes, "更新说明")
|
||||
Assert.is_true(got.available)
|
||||
|
||||
Reference in new issue
Block a user