diff --git a/fetch.lua b/fetch.lua new file mode 100644 index 0000000..5369e5b --- /dev/null +++ b/fetch.lua @@ -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()