Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if #({...}) < 2 then
- print("Usage: github-get <url> <file path>");
- return;
- end
- local url = ...;
- local path = select(2, ...);
- print("Downloading...");
- local response = http.get(url);
- if response then
- local fileContent = response.readAll();
- response.close();
- local file = fs.open(path, "w");
- file.write(fileContent);
- file.close();
- print("Saved file as " .. path);
- else
- print("Failed to download provided file. Please retry.");
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement