diff --git a/compcount.lua b/compcount.lua index 6a3bc52..46dde2c 100644 --- a/compcount.lua +++ b/compcount.lua @@ -8,6 +8,19 @@ local SCREEN_WIDTH, SCREEN_HEIGHT = mon.getSize() local oldTerm = term.redirect(mon) +local function ensureDependency(path, url) + if fs.exists(path) then + return + end + + assert(shell and type(shell.run) == "function", "Shell API nicht verfuegbar") + assert(shell.run("wget", url, path) and fs.exists(path), "Konnte Abhaengigkeit nicht laden: " .. path) +end + +ensureDependency("Pine3D.lua", "https://raw.githubusercontent.com/Xella37/Pine3D/main/Pine3D.lua") +ensureDependency("betterblittle.lua", "https://raw.githubusercontent.com/Xella37/Pine3D/main/betterblittle.lua") +ensureDependency("morefonts-pe.lua", "https://raw.githubusercontent.com/MichielP1807/more-fonts/main/pine3d/morefonts-pe.lua") + local Pine3D = require("Pine3D") local mf = require("morefonts-pe")