Created
May 31, 2011 13:16
-
-
Save DaveEveritt/1000478 to your computer and use it in GitHub Desktop.
Installing TextMate bundles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
############################################################################ | |
# Run from your 'Home' folder. | |
# Replace 'Bundle Name' with exact name (include spaces but not ".tmbundle") | |
# ./tm_bundle.sh Bundle Name | |
# | |
# This script is adapted from the scripts in this list of bundles: | |
# http://netcetera.org/cgi-bin/tmbundles.cgi | |
# the 'official' bundle list with extensions is at: | |
# http://svn.textmate.org/trunk/Bundles/ | |
# | |
# Dave Everitt 2010 (deveritt[at]innotts.co.uk) | |
# TO DO: add path to 'Bundles' as variable | |
############################################################################ | |
# exit if errors: | |
set -e | |
LC_CTYPE=en_US.UTF-8 | |
SVN=`which svn` | |
# get the bundle name (including spaces if any) with $* | |
# if a bundle name was not not given (! -n), quit | |
test ! -n "$*" && { echo No bundle name given - quitting.; exit 1; } | |
echo Changing to your Bundles directory... | |
# make the user's Bundles folder *only* if it doesn't exist (with -p) | |
mkdir -p "./Library/Application Support/TextMate/Bundles" | |
cd "./Library/Application Support/TextMate/Bundles" | |
# if bundle exists, update (overwrite) it, else intall into correct folder | |
if [ -d "./Library/Application Support/TextMate/Bundles/$*.tmbundle" ] | |
then | |
echo $* bundle already exists - updating... | |
$SVN up "$*.tmbundle" | |
else | |
echo Checking out bundle: $* ... | |
$SVN --username anon --password anon co "http://svn.textmate.org/trunk/Bundles/$*.tmbundle/" | |
fi | |
echo Reloading bundles in TextMate... | |
osascript -e 'tell app "TextMate" to reload bundles' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment