fetch.lua, a program fetching utility

This commit is contained in:
Emerson Rosen-Jones 2025-08-18 17:23:16 -04:00
parent d2ca23d179
commit 8c4cdacb70

16
fetch.lua Normal file
View file

@ -0,0 +1,16 @@
-- Program to fetch other programs
local filename = arg[1]
local url = "https://git.emersonmakes.com" ..
"/filigreed/cc-stuff/raw/branch/main/" ..
filename
result = http.get(url)
if result == nil then
print(filename .. " is not a valid file to fetch.")
os.exit(1)
end
local file = fs.open(filename, "w")
file.write(result.readAll())
file.close()