←  Programs

ComputerCraft | Programmable Computers for Minecraft

»

[1.3] Cc-Get 0.1.1

DJRanger's Photo DJRanger 22 Feb 2012

Update: Released a bug fix/update for ComputerCraft 1.3.
About cc-get
cc-get was created in the hope that it would make it easier to install, use and distribute scripts for ComputerCraft. All users may download and use cc-get without an account, however in order to post scripts on the cc-get website you must have an account.
Features
  • cc-get install <program> [-v version]
    Where <program> is the name of a program found on this website. It will install <program> to /bin/<program>-lib. If the author of the program has specified that the program should be available
    on your path a file will also be created at /bin/<program>. If you provide a valid version number, that version will be installed.
  • cc-get update
    This will check to see if any scripts need to be updated. If a program needs to be updated it will do so.
  • cc-get remove <program>
    This will remove <program> from the computer
  • cc-get list
    This will give you a list of all programs installed and their versions.
Installation
If you have Redworks installed
You should already have cc-get. Although cc-get is not developed by the RedWorks team, it is included in their package.
Install cc-get
Download the latest version of cc-get from cc-get.djranger.com/downloads. Enable the HTTP API if needed, then extract the file you downloaded to .minecraft/mods. If prompted to do so overwrite, combine or merge files and directories as needed.

The program library, more information, detailed installation steps and more are available at cc-get.djranger.com.
Quote

MewK's Photo MewK 22 Feb 2012

I love your script <3
Three suggestions though:
  • Some kind of dependency function would be awesome, so i can define my depencies on your site (like StringUtil or other libs) and cc-get will download everthing i need
  • Right now I'm limited two one script per project. Would be awesome if you could support additional API files and stuff like that I just realized that you added this function already. thanks!
  • Is it possible to define aliases that cc-get can automatically install persistently?
Quote

DJRanger's Photo DJRanger 23 Feb 2012

View PostMewK, on 22 February 2012 - 11:42 PM, said:

I love your script <3
Three suggestions though:
  • Some kind of dependency function would be awesome, so i can define my depencies on your site (like StringUtil or other libs) and cc-get will download everthing i need
  • Right now I'm limited two one script per project. Would be awesome if you could support additional API files and stuff like that I just realized that you added this function already. thanks!
  • Is it possible to define aliases that cc-get can automatically install persistently?

1. I am working on adding support for dependencies. I've been pretty busy, but that is my next planned feature.
3. I'm not sure what you mean. Can you give me an example?
Quote

MewK's Photo MewK 23 Feb 2012

View PostDJRanger, on 23 February 2012 - 07:10 PM, said:

3. I'm not sure what you mean. Can you give me an example?

Sure. I can run 'shell.setAlias(...)' after the first run, but it would be nice if cc-get could do that during the install/update process and on startup.

PS: Another feature I would definitely love to see is a GitHub integration. You could require a cc-get.conf file in the repo that has all the settings you need (version, description, etc). That means for us devs, that we have just to commit our changes, and all the deployment is done. And for the users it means, that they can get the latest releases per DDL (directly from GitHub) and cc-get.
Quote

VegBerg's Photo VegBerg 24 Feb 2012

I get errors when I try to install packages, and when I try to run them. (They work when I download them manually, and the script is the same.)
Running latest version as of now. (0.1.0), and the HTTP API is enabled.

Posted Image
Quote

MewK's Photo MewK 24 Feb 2012

And I get an exception when I try to update my project :3

Warning: file_put_contents(/home/djranger/cc-get.djranger.com/projects/midcraft-commander/drawin.lua) [function.file-put-contents]: failed to open stream: No such file or directory in /home/djranger/cc-get.djranger.com/application/classes/model/script.php on line 80

Warning: file_put_contents(/home/djranger/cc-get.djranger.com/projects/midcraft-commander/filesystem.lua) [function.file-put-contents]: failed to open stream: No such file or directory in /home/djranger/cc-get.djranger.com/application/classes/model/script.php on line 80

Fatal error: Uncaught exception 'GitRuntimeException' with message 'Command cd '/home/djranger/cc-get.djranger.com/projects/midcraft-commander' && /usr/bin/git add -A failed with code 1: ' in /home/djranger/cc-get.djranger.com/modules/git/vendor/php-git/lib/PHPGit/Command.php:58 Stack trace: #0 /home/djranger/cc-get.djranger.com/modules/git/vendor/php-git/lib/PHPGit/Repository.php(195): PHPGit_Command->run() #1 /home/djranger/cc-get.djranger.com/application/classes/model/script.php(109): PHPGit_Repository->git('add -A') #2 /home/djranger/cc-get.djranger.com/application/classes/model/version.php(172): Model_Script->edit_files(Array) #3 /home/djranger/cc-get.djranger.com/application/classes/controller/scripts.php(168): Model_Version->save() #4 [internal function]: Controller_Scripts->action_edit() #5 /home/djranger/cc-get.djranger.com/system/classes/kohana/request/client/internal.php(118): ReflectionMethod->invoke(Object(Controller_Scripts)) #6 /home/djranger/cc-get.djranger.com/system/classes/kohana/request/client.php(64): in /home/djranger/cc-get.djranger.com/modules/git/vendor/php-git/lib/PHPGit/Command.php on line 58

PS: Something went terribly wrong xD Loo at that:

http://cc-get.djranger.com/scripts/view/52


PPS: I added a new directory, saved my project, and after that I've deleted it again. After clicking on Save the error occurt.
Quote

DJRanger's Photo DJRanger 24 Feb 2012

View PostMewK, on 23 February 2012 - 09:17 PM, said:

Sure. I can run 'shell.setAlias(...)' after the first run, but it would be nice if cc-get could do that during the install/update process and on startup.

PS: Another feature I would definitely love to see is a GitHub integration. You could require a cc-get.conf file in the repo that has all the settings you need (version, description, etc). That means for us devs, that we have just to commit our changes, and all the deployment is done. And for the users it means, that they can get the latest releases per DDL (directly from GitHub) and cc-get.
Have you seen "Command to run" on project pages? I think that might be what you're after. Most projects should have a file on the path that you can run. Allowing the user to pick a name for a program might be nice though.

As for GitHub integration, I agree that would be nice, but for now it's low priority.

View PostVegBerg, on 24 February 2012 - 06:08 PM, said:

I get errors when I try to install packages, and when I try to run them. (They work when I download them manually, and the script is the same.)
Running latest version as of now. (0.1.0), and the HTTP API is enabled.

View PostMewK, on 24 February 2012 - 06:50 PM, said:

And I get an exception when I try to update my project :3
I'm looking into the errors. Thank you for letting me know. I'll post more information when I have a fix.
Quote

MewK's Photo MewK 24 Feb 2012

View PostDJRanger, on 24 February 2012 - 07:51 PM, said:

Have you seen "Command to run" on project pages? I think that might be what you're after. Most projects should have a file on the path that you can run. Allowing the user to pick a name for a program might be nice though.

Yea, I was using that feature. But I want an alias too :)/> My project name is midcraft-commander, which is a good name for the project, but to have the alias 'mc' too would make things a lot easier.
Quote

VegBerg's Photo VegBerg 24 Feb 2012

View PostDJRanger, on 24 February 2012 - 07:51 PM, said:

View PostMewK, on 23 February 2012 - 09:17 PM, said:

Sure. I can run 'shell.setAlias(...)' after the first run, but it would be nice if cc-get could do that during the install/update process and on startup.

PS: Another feature I would definitely love to see is a GitHub integration. You could require a cc-get.conf file in the repo that has all the settings you need (version, description, etc). That means for us devs, that we have just to commit our changes, and all the deployment is done. And for the users it means, that they can get the latest releases per DDL (directly from GitHub) and cc-get.
Have you seen "Command to run" on project pages? I think that might be what you're after. Most projects should have a file on the path that you can run. Allowing the user to pick a name for a program might be nice though.

As for GitHub integration, I agree that would be nice, but for now it's low priority.

View PostVegBerg, on 24 February 2012 - 06:08 PM, said:

I get errors when I try to install packages, and when I try to run them. (They work when I download them manually, and the script is the same.)
Running latest version as of now. (0.1.0), and the HTTP API is enabled.

View PostMewK, on 24 February 2012 - 06:50 PM, said:

And I get an exception when I try to update my project :3
I'm looking into the errors. Thank you for letting me know. I'll post more information when I have a fix.
Thanks!

Also, I guess this was inspired by apt-get/aptitude? :)/> Ubuntu<3
Quote

Selkitty's Photo Selkitty 24 Feb 2012

Is it possible to specify the directory where programs are installed to? previously I made a program that moved a specific downloaded file over to a floppy, but it'd be nice if you could do that right there inside cc-get. then we could have something like redworks floppy version right there in cc-get and download it directly to a floppy :)/>
Quote

DJRanger's Photo DJRanger 24 Feb 2012

View PostVegBerg, on 24 February 2012 - 06:08 PM, said:

I get errors when I try to install packages, and when I try to run them. (They work when I download them manually, and the script is the same.) Running latest version as of now. (0.1.0), and the HTTP API is enabled.
I already told you this in IRC, but for anyone else having this problem: Version 0.1.1 fixes this problem. It was specific to ComputerCraft 1.3. If you haven't updated ComputerCraft, make sure you update cc-get first otherwise this bug might corrupt your packages.json file.

View PostMewK, on 24 February 2012 - 08:02 PM, said:

Yea, I was using that feature. But I want an alias too :D/> My project name is midcraft-commander, which is a good name for the project, but to have the alias 'mc' too would make things a lot easier.
That makes sense. I'll keep it in mind for a future version.

View PostMewK, on 24 February 2012 - 06:50 PM, said:

And I get an exception when I try to update my project :3
It seems that when I updated the site, somehow your project didn't get migrated. I restored it from a backup but the last version, 0.1.9.9 was lost and you will need to re-add that. It should work this time. I'm sorry for the inconvenience, other people have create/updated their projects on cc-get so it seems to just be a random thing. Let me know if you have anymore problems.

View PostVegBerg, on 24 February 2012 - 09:00 PM, said:

Thanks! Also, I guess this was inspired by apt-get/aptitude? :)/> Ubuntu<3
Ya, it was inspired by apt-get along with other package managers.

View PostSelkitty, on 24 February 2012 - 09:46 PM, said:

Is it possible to specify the directory where programs are installed to?
That's not currently possible. This is another good idea, but I want to get dependencies and some other things released first.
Quote

Selkitty's Photo Selkitty 24 Feb 2012

View PostDJRanger, on 24 February 2012 - 10:56 PM, said:

That's not currently possible. This is another good idea, but I want to get dependencies and some other things released first.
Understandable ^^ my program's a bit crude by most standards but if you'd like to see how I did it the program itself is up on cc-get ^^

(Feel free to rip/mutilate/otherwise render obsolete)
Quote

Mandrake Fernflower's Photo Mandrake Fernflower 26 Feb 2012

CC-GET works very well but I have a few ideas that may be useful.

1. Allow people to download scripts with out cc-get ( Useful for global server script installs)
2. Have a program that can be ran on startup that lists the 10 newist scrips on cc-get
Quote

MewK's Photo MewK 27 Feb 2012

Hey,

could you make the local dir var in the /bin start-scripts global?
i'm using shell.getDir() to get the path the user is currently using, but you're overwriting it.

Just changing
local dir = shell.dir()
to
ccget_dir = shell.dir()
would do the job for me.
If ccget_dir exists I'm using that value instead of shell.getDir() and my program would have no problems.
The other idea I had was passing the dir as the first or last parameter, but that would probably break some programs.
Quote

Casper7526's Photo Casper7526 27 Feb 2012

Mewk: shell.getRunningProgram() might be of use to you?
Quote

MewK's Photo MewK 27 Feb 2012

View PostCasper7526, on 27 February 2012 - 06:10 PM, said:

Mewk: shell.getRunningProgram() might be of use to you?

That just gives me my own path: binmidcraft-commander-libmidcraft-commander
How can that help me? o.o I there something I don't see?
Quote

stoneLeaf's Photo stoneLeaf 08 Mar 2012

Great software!
I look forward to the next updates.
Quote

stoneLeaf's Photo stoneLeaf 17 Mar 2012

Could be great to have a list of the most popular programs on cc-get's front page.
Quote