From 8c4cdacb7095d8b722f21d1ee3792137e5d79079 Mon Sep 17 00:00:00 2001 From: Emerson Rosen-Jones Date: Mon, 18 Aug 2025 17:23:16 -0400 Subject: [PATCH] fetch.lua, a program fetching utility --- fetch.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 fetch.lua 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()