diff --git a/rescue-from-github.lua b/rescue-from-github.lua index bc4e8bd..fd19780 100755 --- a/rescue-from-github.lua +++ b/rescue-from-github.lua @@ -2,25 +2,25 @@ package.path = (arg[0]:match("@?(.*/)") or arg[0]:match("@?(.*\\)")) .. "lib" .. package.config:sub(1, 1) .. "?.lua;" .. package.path local utility = require "utility" --- reformatting the mirrors list in my new file to the format I want +-- TEMP import repos from export, add target information to mirrors +local export = utility.load_data("export.json") local data = utility.load_data("respositories.json") -local mirrors = { - ["https://github.com/"] = { - TangentFoxy = {} - } -} -for _, name in ipairs(data.mirrors) do - mirrors["https://github.com/"].TangentFoxy[name] = {} -end -data.mirrors = mirrors -utility.save_data(data) -os.exit() +data.respositories["https://gitea.tangentfox.com/"] = {} +local old_site = data.respositories["https://gitea.tangentfox.com/"] --- making sure all mirror keys are repos under my name on GitHub -local data = utility.load_data("export.json") -for _, name in ipairs(data.mirrors) do - os.execute("open " .. ("https://github.com/TangentFoxy/" .. name):enquote()) +for name, repo in pairs(export.repositories) do + local org = repo.organization + if not old_site[org] then old_site[org] = {} end + old_site[org][name] = { description = repo.description, website = repo.website, } end + +for url, org in pairs(data.mirrors["https://github.com/"]) do + for name, repo in pairs(org) do + repo.target = "https://gitea2.tangentfox.com/mirrors/" .. name + end +end + +utility.save_data(data) os.exit() -- TODO add support for private repos by making it warn the user @@ -29,57 +29,15 @@ os.exit() local repositories = { ["2dcraft"] = "A 2D infinite world survival game concept. (Minetest meets Factorio?)", auroraclone = "Another attempted clone of Aurora, the 4X spreadsheet game.", - ["52-cards"] = "Playing cards.", - BSG = "Battlestar Galactica fan-game (not even prototype yet).", ["bullet-hell"] = { organization = "prototype", description = "A prototype bullet hell game!", }, - ["Drabble-Readings"] = "Recordings of me reading my drabble (for submission to the 100 Word Stories Podcast).", - erectus = { - organization = "prototype", - description = "Basic simulation of an enclosed space & life support systems.", - }, - fade = "A very impermanent drawing tool.", - Fluid = { - organization = "prototype", - description = "A better system for basic simulation of fluids in containers.", - }, - ideas = { - description = "design docs / misc. ideas", - website = "https://share.note.sx/gdon3y36", - }, neralie = { organization = "tools", description = "A simple clock for the Neralie decimal time format.", website = "https://wiki.xxiivv.com/site/time", }, - ["one-off-scripts"] = "An archive for old scripts.", - owen = { - organization = "prototype", - description = "Small polygonal ship generator.", - }, - particular = { - organization = "prototype", - description = "A super basic particle simulator (better as a visualizer.. of nothing in particular).", - }, - RGB = "My first successful game, where you have to try to match colors using the 3 mouse buttons.", -- default org: tangent, string means description - sever = { - organization = "prototype", - description = "Prototype simplistic engine simulation for generating power.", - }, - ["Simple-Kerbal-Mods"] = "KSP Agencies!", - slab = "A very not usable (yet?) Love2D GUI library.", - SpaceLove = "My first \"fly a fighter\" prototype... FROM 2014! D:", - ["The-Snap"] = { - description = "The Snap balances your browsing habits by closing a random half of open tabs.", - website = "https://blog.tangentfox.com/the-snap-browser-extension/", - }, - ThompsonWasAClone = "shit Thomas Was Alone clone", - xi = { - organization = "prototype", - description = "A borderless fullscreen \"screensaver\" of a galactic travel network.", - }, } -- TODO figure out how to use API to automatically set these up @@ -87,22 +45,6 @@ local mirrors = { "markdown.lua", "love-pe", "slam", - "Piefiller", - "heightmap", - "rxi-json.lua", - "etlua", - "lua-date", - "lurker", - "lua-htmlparser", - "baton", - "lovebird", - "argparse", - "love-release", - "lume", - "semver.lua", - "lua-sandbox", - "dkjson.lua", - "inspect.lua", } local organizations = {} @@ -139,17 +81,6 @@ end)() table.sort(repository_names) --- I don't know what data I actually need from this script or how to organize it --- so I'm just exporting everything for the moment -local data = { - repositories = repositories, - organizations = organizations, - mirrors = mirrors, - repository_names = repository_names, -} -utility.save_data(data, "export.json") -os.exit() - -- TODO figure out how to use the API to do this automatically -- TODO figure out how to set a description as well print("Create the following organizations:")