0

Is there a package system (think npm, cpan, or even homebrew) that would be suitable for shell scripts?

2
  • Can you expand on what your requirments are? – mmmmmm Apr 18 '13 at 8:55
  • 1
    @Mark Easily distribute a shell script, ideally with support for updating the script, etc. Lots of people are doing curl https://install.example.com | /bin/sh type things, I was wondering if there was a better way. – julien_c Apr 18 '13 at 9:39
1

If you need traditional revision control, you can easily use GitHub even if you don’t know git via their free Mac app. I’ve done that at https://github.com/tjluoma?tab=repositories.

If you just want sharing, put your scripts on Dropbox. For example, I save mine in ~/Dropbox/bin/ which I’ve added to my $PATH so they’re available on all my Macs. View the file on Dropbox.com and choose the share option, then choose ‘Twitter’ to get the short URL like https://db.tt/oOYTUPB4 or the longer one like https://www.dropbox.com/s/8l906xc39uo2cbc/dock.sh

The advantage (or disadvantage, I suppose) of the Dropbox version is that it will always share the most recent version of the script without you having to do any sort of official check-in procedure.

The primary disadvantage of the Dropbox method is that the URL leads to a web page for the script, whereas the direct (or “raw”) version of the script can be located by adding ?dl=1 to the URL, such as https://www.dropbox.com/s/8l906xc39uo2cbc/dock.sh?dl=1

1

Shell scripts don't need much packaging, so most people use a source control system for this. There are dozens of options, but I'd start with github and come back with a more detailed question once the github / source control system broke under the strain of volume of your scripts or the complexity of the situation.

As it stands, we can only guess what your true requirements are since all three examples you list run natively on OS X and you can roll your own packages according to each recipe if you prefer to use them.

For internet hosting, you could easily use GitHub since they host files for download or you could push the files to Amazon S3 and many other cloud hosting services that serve up files for free or inexpensively. Amazon for example allows 5 GB of free space and 20,000 hits per month before you need to pay them anything. Dropbox also has no practical limit on the number of hits, but offers less space initially if you were to sign up for a new account with them.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .