Package management system for shell scripts on Mac OS

command lineterminal

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

Best Answer

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