Monday, September 22, 2008

Installing the Erlang Textmate bundle

Came across this script recently that bascially checked out and installed an Erlang TextMate bundle. If you're wanting to install an Erlang bundle into TextMate, this is how you do it.

  1. In TextMate, go to Bundles >> Bundle Editor >> Show Bundle Editor
  2. If you do not currently have "Erlang" as an option in the list of Bundles to the left, go ahead and create a place holder one. To do so, click the "+" sign down below and select "New Bundle". This script you're about to run will create "Erlang" so I'd recommend naming it something like "erlang" or "erlang-tmp".
  3. In this new bundle, add a new command and call it "reload" or "erl-bund-checkout" or whatever works for you. For the "Save" option select "Nothing". For the Input option, select "None" and for the Output option select "Show as tool tip". Then copy and paste in this code into the "Command(s):" text-box:
    #!/bin/sh

    LC_CTYPE=en_US.UTF-8
    SVN=`which svn`

    echo Changing to Bundles directory...
    mkdir -p /Library/Application\ Support/TextMate/Bundles
    cd /Library/Application\ Support/TextMate/Bundles

    if [ -d /Library/Application\ Support/TextMate/Bundles/Erlang.tmbundle ]; then
    echo Erlang bundle already exists - updating...
    $SVN up Erlang.tmbundle
    else
    echo Checking out Erlang bundle...
    $SVN --username anon --password anon co http://macromates.com/svn/Bundles/trunk/Bundles/Erlang.tmbundle/
    fi

    echo Reloading bundles in TextMate...
    osascript -e 'tell app "TextMate" to reload bundles'


  4. That's it!. Now you can run that command by selecting it from the "Bundles" menu and after you do, you'll see a tooltip showing you what was checked now. You will also see the new "Erlang" Language option in the Bundles menu and as a Language option at the bottom of the TextMate window.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home