Jump to content




gitget - Version 2 release!

utility lua computer

32 replies to this topic

#21 Obnoxious_Ninja

  • Members
  • 14 posts

Posted 30 June 2014 - 01:23 PM

View PostLua.is.the.best, on 07 June 2014 - 01:48 AM, said:

I.. sense.. AWESOMENESS!!
Now I can finally create an installer without creating a function called get(repo, file) and then calling it like a hundred times!!
Now, all I have to do is:
local username = "aepic999"
local repo = "MyProject"
function hte()
if fs.exists(gitget)
shell.run("gitget", username, repo)
else
print("GitGet application does not exist. Downloading...")
shell.run("pastebin", "get", "6aMMzdwd", "gitget")
shell.run("gitget", username, repo)
end
echo("Installed.")
end
if http then
print("HTTP enabled. You can continue.")
hte()
else
print("HTTP not enabled. App will not continue.")
end
while my other version that used get() was long, and I gave up when I reached the API folder.
EDIT: Put a measure in there to make sure it doesn't still run the code when HTTP API is off.
EDIT 2: Put the hte() function directly after the variables so the if wouldn't get confused, nor the function.
EDIT 3: And just to note, if you want to make this your own, change "username" and "repo", but KEEP THEM STRINGS! If you don't, the shell.run() calls I use will fail.
EDITSAURUS: You can hard-code the strings (hardcoded: not in variable or dependent on variables).

Well, it would be more user friendly if it looked more like:
local username = "aepic999"
local repo = "MyProject"
function hte()
  if fs.exists(gitget) then --You missed this
    shell.run("gitget", username, repo)
  else
    print("GitGet application does not exist. Downloading...")
    shell.run("pastebin", "get", "6aMMzdwd", "gitget")
    shell.run("gitget", username, repo)
  end
  if fs.exists("one of your files") then --You don't check if it was installed before saying it was installed
    print("Installed.") -- echo?
    else
      print("An error occured while attempting to install.")
  end
end

if http then
  print("HTTP enabled. You can continue.")
  hte()
  else
    print("HTTP not enabled. App will not continue.")
end


#22 Lua.is.the.best

  • Members
  • 76 posts

Posted 10 July 2014 - 02:30 AM

Uhm..
Still, doesn't look right.
You aren't putting else in the if, it's part of an if, so:
(Hint: It doesn't matter about indentation, indentation makes it look like it's in the function or whatever more)
if http then
  print("HTTP enabled. You can continue.")
  hte()
else
  print("HTTP not enabled. App will not continue.")
end

Edited by Lua.is.the.best, 10 July 2014 - 02:31 AM.


#23 apemanzilla

  • Members
  • 1,421 posts

Posted 27 March 2015 - 01:55 AM

GitGet version 2 is released! Changes include:
  • Asynchronous downloads for huge speed increases
  • Will now retry failed files
  • Progress bar instead of spamming files
  • Bugfixes
  • More user-friendly preset mode
Tell me what you guys think!

#24 Geforce Fan

  • Members
  • 846 posts
  • LocationMissouri, United States, America, Earth, Solar System, Milky Way, Universe 42B, Life Street, Multiverse, 4th Dimension

Posted 27 March 2015 - 02:00 AM

I hope my installer still works, because it literly(don't judge) runs gitget off pastebin.
edit: you made a new pasteID. Will update it to that though.

Edited by Geforce Fan, 27 March 2015 - 02:02 AM.


#25 apemanzilla

  • Members
  • 1,421 posts

Posted 27 March 2015 - 02:05 AM

View PostGeforce Fan, on 27 March 2015 - 02:00 AM, said:

I hope my installer still works, because it literly(don't judge) runs gitget off pastebin.
edit: you made a new pasteID. Will update it to that though.

Yeah, I purposely made it as a new paste just in case people were doing something like this. I recommend editing it and putting your own version of gitget on pastebin as an installer however. It's more flexible that way.

#26 Geforce Fan

  • Members
  • 846 posts
  • LocationMissouri, United States, America, Earth, Solar System, Milky Way, Universe 42B, Life Street, Multiverse, 4th Dimension

Posted 27 March 2015 - 02:06 AM

Woah. The new gitget is WAY faster.
Do you mind if I include this as a default program in my OS?

Edited by Geforce Fan, 27 March 2015 - 02:12 AM.


#27 apemanzilla

  • Members
  • 1,421 posts

Posted 27 March 2015 - 02:30 AM

View PostGeforce Fan, on 27 March 2015 - 02:06 AM, said:

Woah. The new gitget is WAY faster.
Do you mind if I include this as a default program in my OS?

Nope, just add credits please :)

The way it works now is it sends ALL the file requests at once, then saves the files as the events for each one trigger. Previously, it would request one file, wait for it, save it, and then continue to the next one. So yeah, much faster :P

Edit: Just made a minor change to gitget that might help with operating system support (no longer requires the shell API)

Edited by apemanzilla, 27 March 2015 - 02:37 AM.


#28 Geforce Fan

  • Members
  • 846 posts
  • LocationMissouri, United States, America, Earth, Solar System, Milky Way, Universe 42B, Life Street, Multiverse, 4th Dimension

Posted 27 March 2015 - 08:47 PM

Most, if not all OSes give programs the Shell API. Mine does, it even uses it itself!

Edited by Geforce Fan, 27 March 2015 - 08:48 PM.


#29 apemanzilla

  • Members
  • 1,421 posts

Posted 28 March 2015 - 01:06 AM

View PostGeforce Fan, on 27 March 2015 - 08:47 PM, said:

Most, if not all OSes give programs the Shell API. Mine does, it even uses it itself!

Just to be safe ;)

#30 sandalle

  • New Members
  • 1 posts

Posted 31 March 2015 - 09:51 PM

Hey apemanzilla, thanks for putting this together. :) I was looking at ways to update https://github.com/s...eactor_control/ in pastebin via WebHooks, but pastebin only seems to allow for creating new entries and not updating existing ones with the API, plus I couldn't seem to modify the WebHooks to be very versatile in what they send to pastebin.

So, I'm looking at using this for pulling down updates, but I would like to only pull from the latest post in https://github.com/s...ontrol/releases (see https://github.com/s...releases/latest for always latest release) and not every commit to master (since that's where semi-tested and untested code goes, especially when merging pull requests :)). I don't need the whole ZIP or .tar.gz file, just a specific file ( e.g. latest release is 0.3.16 with https://github.com/s...onitor_prog.lua ), though grabbing the ZIP or .tar.gz and uncompressing would work, too.

I did not see gitget (nor gitget2) on https://github.com/a...ab=repositories to submit an enhancement request. :)

#31 apemanzilla

  • Members
  • 1,421 posts

Posted 02 April 2015 - 12:23 AM

View Postsandalle, on 31 March 2015 - 09:51 PM, said:

Hey apemanzilla, thanks for putting this together. :)/> I was looking at ways to update https://github.com/s...eactor_control/ in pastebin via WebHooks, but pastebin only seems to allow for creating new entries and not updating existing ones with the API, plus I couldn't seem to modify the WebHooks to be very versatile in what they send to pastebin.

So, I'm looking at using this for pulling down updates, but I would like to only pull from the latest post in https://github.com/s...ontrol/releases (see https://github.com/s...releases/latest for always latest release) and not every commit to master (since that's where semi-tested and untested code goes, especially when merging pull requests :)/>). I don't need the whole ZIP or .tar.gz file, just a specific file ( e.g. latest release is 0.3.16 with https://github.com/s...onitor_prog.lua ), though grabbing the ZIP or .tar.gz and uncompressing would work, too.

I did not see gitget (nor gitget2) on https://github.com/a...ab=repositories to submit an enhancement request. :)/>
Try putting releases in a separate branch. Then you can use gitget2 to download just the necessary branch. For example, merge the latest "release" code into the branch "releases" and then run "gitget sandalle minecraft_bigreactor_control releases" to download it.

I'm keeping gitget2 on pastebin so you can download it without needing a version of gitget.

#32 houseofkraft

  • Members
  • 170 posts
  • LocationUSA

Posted 08 March 2017 - 10:38 PM

May I turn GitGet into an API so I can use it for my program.

#33 apemanzilla

  • Members
  • 1,421 posts

Posted 09 March 2017 - 03:01 AM

View Posthouseofkraft, on 08 March 2017 - 10:38 PM, said:

May I turn GitGet into an API so I can use it for my program.

Sure, but please add my name in the credits.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users