Skip to content

Instantly share code, notes, and snippets.

@amiel
Created April 14, 2011 20:51
Show Gist options
  • Save amiel/920507 to your computer and use it in GitHub Desktop.
Save amiel/920507 to your computer and use it in GitHub Desktop.
How to get GetBundles to work with rvm

This is how I got GetBundles to work with rvm.

  1. Open the Bundle Editor (Bundles -> Bundle Editor -> Show Bundle Editor).
  2. Find GetBundles and select the Get Bundles command.
  3. Paste the following to the text area.

Finding the Get Bundles command in the Bundle Editor

#!/bin/bash
if [ `echo -n "$DIALOG" | tail -c 1` != "2" ]; then
CHECK=$("$DIALOG" -l | egrep -c 'TextMate — GetBundles')
else
CHECK=$("$DIALOG" nib --list | egrep -c 'TextMate — GetBundles')
fi
[[ ! -d ~/Library/Logs ]] && mkdir -p ~/Library/Logs
rm -f ~/Library/Logs/TextMateGetBundles.log
if [ $CHECK == 0 ]; then
# All I changed was add the call to rvm here
# You might need to be more specific with your ruby version;
# I have 1.8.7-p203
~/.rvm/bin/rvm 1.8.7 ruby -wKU "'$TM_BUNDLE_SUPPORT/getBundles.rb'" &>~/Library/Logs/TextMateGetBundles.log &
else
ERR=$(cat <<-AS | iconv -f UTF-8 -t MACROMAN | osascript -- 2>&1 1>/dev/null
tell application "TextMate" to activate
tell application "System Events" to tell process "TextMate" to tell menu bar 1 to tell menu bar item "Window" to tell menu "Window" to click menu item "TextMate — GetBundles"
AS
)
[[ ! -z $ERR ]] && echo "GetBundles is already running"
fi
@simple
Copy link

simple commented Jul 5, 2011

FYI, I had to use "/.rvm/rubies/ruby-1.8.7-head/bin/ruby" instead of "/.rvm/bin/rvm 1.8.7" with rvm 1.6.20.

@amiel
Copy link
Author

amiel commented Jul 5, 2011

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment