diff --git a/rescue-from-github.lua b/rescue-from-github.lua index 7588b45..f640749 100755 --- a/rescue-from-github.lua +++ b/rescue-from-github.lua @@ -1,4 +1,6 @@ #!/usr/bin/env luajit +package.path = (arg[0]:match("@?(.*/)") or arg[0]:match("@?(.*\\)")) .. "lib" .. package.config:sub(1, 1) .. "?.lua;" .. package.path +local utility = require "utility" -- TODO add support for private repos by making it warn the user @@ -98,9 +100,9 @@ for name, info in pairs(repositories) do table.insert(repository_names, info.organization .. "/" .. name) -- TODO figure out how to detect and exclude repos that don't need to be cloned (check what exists on my domain!) - os.execute("git clone https://TangentFoxy@github.com/TangentFoxy/" .. name) + -- os.execute("git clone https://TangentFoxy@github.com/TangentFoxy/" .. name) - -- os.execute("cd " .. name .. " && git branch") + -- os.execute("cd " .. name .. " && git branch") -- TODO figure out why I had this? do I need to manually push each branch or does that happen automatically? end -- if true then os.exit() end @@ -116,6 +118,17 @@ 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:")