Hello.
I am creating an installer, for an OS.
The problem is, the method I am using requires me to use a function like:
get(string repoFile, string saveTo)
So, for example, if I wanted to get a file called EpicTest/Test off a repo and put it in EpicTest, I would use:
get("EpicTest/Test","EpicTest/Test")
If it didn't exist, I would add mkdir("EpicTest") before the function. (person-made functions rule!)
How do I get a system that can download a whole folder at a time?
For example, instead of typing
get("epic/Test1","Test1")
get("epic/Test2","Test2")
to get those two files, to get a whole folder, I could type
getFolder("epic","epic")
The first "epic" is the repo folder.
The second one is the saving directory.
Get all files from a folder in GitHub and put them inside a computer's folder
Started by Lua.is.the.best, May 11 2014 04:53 PM
2 replies to this topic
#1
Posted 11 May 2014 - 04:53 PM
#2
Posted 11 May 2014 - 05:28 PM
You'd have to scan the whole folder for files obviously. I don't know much about JSON, but i managed to cobble together a functional installer using string.match.
http://pastebin.com/VTZ6CqWY
Seems there is an url that contains the contents of the repo,
https://api.github.c...r/repo/contents
It's been awhile since i did this, and i didn't bother commenting it lol. Anyways have a look through it and see if you can figure out what you're looking for.
http://pastebin.com/VTZ6CqWY
Seems there is an url that contains the contents of the repo,
https://api.github.c...r/repo/contents
It's been awhile since i did this, and i didn't bother commenting it lol. Anyways have a look through it and see if you can figure out what you're looking for.
#3
Posted 11 May 2014 - 06:16 PM
Thank you!
I am definitely using this! *copies*
And wait, how do I add a blacklist?
I understand the api.github and all that, but how do I use it?
I'm confused, especially with the way they describe the stuff.
For example my desktop folder =
Quote
[
{
"name": "Desktop",
"path": "Desktop",
"sha": "d611e3dd8209f473e85eb76b1836f985e442f1d2",
"size": 0,
"url": "https://api.github.com/repos/aepic999/MyProject/contents/Desktop?ref=master",
"html_url": "https://github.com/aepic999/MyProject/tree/master/Desktop",
"git_url": "https://api.github.com/repos/aepic999/MyProject/git/trees/d611e3dd8209f473e85eb76b1836f985e442f1d2",
"type": "dir",
"_links": {
"self": "https://api.github.com/repos/aepic999/MyProject/contents/Desktop?ref=master",
"git": "https://api.github.com/repos/aepic999/MyProject/git/trees/d611e3dd8209f473e85eb76b1836f985e442f1d2",
"html": "https://github.com/aepic999/MyProject/tree/master/Desktop"
}
},
{
{
"name": "Desktop",
"path": "Desktop",
"sha": "d611e3dd8209f473e85eb76b1836f985e442f1d2",
"size": 0,
"url": "https://api.github.com/repos/aepic999/MyProject/contents/Desktop?ref=master",
"html_url": "https://github.com/aepic999/MyProject/tree/master/Desktop",
"git_url": "https://api.github.com/repos/aepic999/MyProject/git/trees/d611e3dd8209f473e85eb76b1836f985e442f1d2",
"type": "dir",
"_links": {
"self": "https://api.github.com/repos/aepic999/MyProject/contents/Desktop?ref=master",
"git": "https://api.github.com/repos/aepic999/MyProject/git/trees/d611e3dd8209f473e85eb76b1836f985e442f1d2",
"html": "https://github.com/aepic999/MyProject/tree/master/Desktop"
}
},
{
Edited by Lua.is.the.best, 11 May 2014 - 06:17 PM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











