Fork me on GitHub

article

Easily install and update TextMate bundles from SVN

May 31, 2007 | Computers

This script has been updated

This script was updated on 2008/01/17. Since the version released here had a fatal flaw I have replaced the file linked below. Click here to see the details on the latest version of this script.

I’m lazy. I’ll admit it. It comes at weird expenses though. I’m too lazy to remember the subversion commands for updating TextMate bundles and keeping the support folder up to date, and the GetBundle bundle never seems to completely update or remember what it has updated, so I spend time learning how to script the damn thing via bash. Weird. But handy.

tmbundle.sh is the result of that effort. Its a pretty simple bash script that allows for listing available bundles, installing a bundle, and updating all installed bundles. This script is only for items from the Subversion repository of TextMate bundles, so if you haven’t pulled the SVN version of the HTML.tmbundle it will not update the default bundle that shipped with TM. It will not update a bundle that you have not already pulled from the SVN repository. Install only allows for installing one bundle at a time (I haven’t researched function overloading in bash yet).

Listing available bundles

./tmbundle.sh list

This will show all bundles available in the SVN repository.

Installing a bundle

./tmbundle.sh install XML

This will install the XML bundle. The script will assume the .tmbundle extension if its not given, so telling it XML.tmbundle is the same as telling it just XML. Long names with spaces need to be encapsulated in quotes. So, for example:

./tmbundle.sh install "JavaScript Prototype & Script_aculo_us.tmbundle"

Any install will automatically update the bundle support folder so that any dependencies are met.

Updating bundles

./tmbundle.sh update

This will update all the bundles that you have installed from SVN as well as the bundle support folder. If you need to just update one bundle, do an install instead.

Conclusion

So, that’s it. Pretty simple and nothing fancy. I’m sure others could easily improve on this or even encapsulate it in an automator action or maybe even using Pashua. For now, though, this works gangbusters for me, and hopefully helps one or two of you out there as well.

2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  • The script was very helpful. Thanks. (1 lazy guy to another)

    Kev, December 4, 2007 6:41 pm | permalink

  • There is actually a problem with it – the update doesn’t work properly. I’ve got it fixed but the fix isn’t integrated with this yet (speaking of lazy).

    Shawn Parker, December 12, 2007 9:14 pm | permalink

Comments are closed