extracted bundles and sent them

This commit is contained in:
2026-08-17 19:24:39 -06:00
parent c45a147e84
commit 6fc0803095
+22 -16
View File
@@ -2,25 +2,31 @@
package.path = (arg[0]:match("@?(.*/)") or arg[0]:match("@?(.*\\)")) .. "lib" .. package.config:sub(1, 1) .. "?.lua;" .. package.path package.path = (arg[0]:match("@?(.*/)") or arg[0]:match("@?(.*\\)")) .. "lib" .. package.config:sub(1, 1) .. "?.lua;" .. package.path
local utility = require "utility" local utility = require "utility"
-- TEMP import repos from export, add target information to mirrors local extract_bundles = function(path)
local export = utility.load_data("export.json") utility.list(path, function(file_name)
local data = utility.load_data("respositories.json") local _, name, extension = utility.split_path_components(file_name)
data.respositories["https://gitea.tangentfox.com/"] = {} if not extension or not (extension == "bundle") then return end -- only work on bundles
local old_site = data.respositories["https://gitea.tangentfox.com/"]
for name, repo in pairs(export.repositories) do local output_path, repo_name
local org = repo.organization if extension then
if not old_site[org] then old_site[org] = {} end repo_name = name:sub(1, -(#extension + 2) - #("-main"))
old_site[org][name] = { description = repo.description, website = repo.website, } output_path = path .. "/" .. repo_name
end
if utility.path_exists(output_path) then
return
end
os.execute("git clone " .. name:enquote() .. " " .. output_path:enquote())
-- TEMP since I happen to be moving Minecraft organization items right now..
-- os.execute("git clone " .. name:enquote() .. " " .. output_path:enquote()
-- .. " && cd " .. output_path:enquote()
-- .. " && git remote set-url origin https://tangent@gitea2.tangentfox.com/Minecraft/" .. repo_name
-- .. " && git push origin")
end)
end end
for url, org in pairs(data.mirrors["https://github.com/"]) do extract_bundles(".")
for name, repo in pairs(org) do
repo.target = "https://gitea2.tangentfox.com/mirrors/" .. name
end
end
utility.save_data(data)
os.exit() os.exit()
-- TODO add support for private repos by making it warn the user -- TODO add support for private repos by making it warn the user