code.cleyrop.techFRENParcourir les dépôts

misehooksbackend_list_tools.lua

main

At commit 6b43a50

20 lines · 655 BLuaRaw
  1. local forge = require("forge")
  2. function PLUGIN:BackendListTools(_ctx)
  3. local base_url = forge.base_url(nil)
  4. local repos = forge.list_repos(base_url)
  5. local tools = {}
  6. for _, repo in ipairs(repos) do
  7. if type(repo) == "table" and type(repo.name) == "string" and repo.name ~= "" then
  8. if type(repo.latest_release) == "string" and repo.latest_release ~= "" then
  9. table.insert(tools, {
  10. name = repo.name,
  11. description = type(repo.description) == "string" and repo.description or "",
  12. })
  13. end
  14. end
  15. end
  16. return { tools = tools }
  17. end