├── Support ├── bin │ ├── svn │ └── autoupdate.sh ├── as │ ├── register.scpt │ ├── updated.scpt │ ├── growl_test.scpt │ ├── installed.scpt │ └── updated_failed.scpt ├── nibs │ └── Bundles.nib │ │ ├── keyedobjects.nib │ │ ├── classes.nib │ │ └── info.nib ├── notify.rb └── show_bundles.rb ├── Commands ├── Show Bundles on Repository.tmCommand ├── Remove AutoUpdater.tmCommand ├── Update Installed Bundles.tmCommand ├── List Installed Bundles.tmCommand ├── Install AutoUpdater.tmCommand └── Install Bundle.tmCommand └── info.plist /Support/bin/svn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/getbundle.tmbundle/master/Support/bin/svn -------------------------------------------------------------------------------- /Support/as/register.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/getbundle.tmbundle/master/Support/as/register.scpt -------------------------------------------------------------------------------- /Support/as/updated.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/getbundle.tmbundle/master/Support/as/updated.scpt -------------------------------------------------------------------------------- /Support/as/growl_test.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/getbundle.tmbundle/master/Support/as/growl_test.scpt -------------------------------------------------------------------------------- /Support/as/installed.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/getbundle.tmbundle/master/Support/as/installed.scpt -------------------------------------------------------------------------------- /Support/as/updated_failed.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/getbundle.tmbundle/master/Support/as/updated_failed.scpt -------------------------------------------------------------------------------- /Support/nibs/Bundles.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/getbundle.tmbundle/master/Support/nibs/Bundles.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Support/nibs/Bundles.nib/classes.nib: -------------------------------------------------------------------------------- 1 | { 2 | IBClasses = ({CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }); 3 | IBVersion = 1; 4 | } -------------------------------------------------------------------------------- /Commands/Show Bundles on Repository.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | "${TM_RUBY:-ruby}" -wKU "$TM_BUNDLE_SUPPORT/show_bundles.rb" &>/dev/null & 9 | input 10 | none 11 | name 12 | Show Bundles on Repository 13 | output 14 | showAsTooltip 15 | uuid 16 | 8C7398D7-1BC2-4F4D-9BA9-AE1520D764AD 17 | 18 | 19 | -------------------------------------------------------------------------------- /Support/nibs/Bundles.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBDocumentLocation 6 | 69 14 356 240 0 0 1920 1178 7 | IBFramework Version 8 | 446.1 9 | IBGroupedObjects 10 | 11 | 1 12 | 13 | 20 14 | 19 15 | 16 | 17 | IBLastGroupID 18 | 2 19 | IBOpenObjects 20 | 21 | 5 22 | 23 | IBSystem Version 24 | 8L127 25 | 26 | 27 | -------------------------------------------------------------------------------- /Commands/Remove AutoUpdater.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | JOB=com.macromates.textmate.bundleupdate 9 | TASK=~/Library/LaunchAgents/$JOB.plist 10 | 11 | if [[ -f "$TASK" ]]; then 12 | launchctl stop "$JOB" 13 | launchctl unload "$TASK" 14 | rm "$TASK" 15 | echo "Auto updater uninstalled." 16 | else 17 | echo "Nothing to uninstall." 18 | fi 19 | input 20 | none 21 | name 22 | Remove AutoUpdater 23 | output 24 | showAsTooltip 25 | uuid 26 | E11461A2-B186-4278-9CB9-95AAC8D9D7C0 27 | 28 | 29 | -------------------------------------------------------------------------------- /Support/bin/autoupdate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SCRIPT_PATH=$(dirname "$0") 4 | DIALOG_PATH=~/Library/Application\ Support/TextMate/Support/bin/CocoaDialog.app/Contents/MacOS/CocoaDialog 5 | BUNDLES_PATH=~/Library/Application\ Support/TextMate/Pristine\ Copy/Bundles 6 | SUPPORT_PATH=~/Library/Application\ Support/TextMate/Support 7 | 8 | # if the user already has svn in the path, prefer that 9 | if type >/dev/null -p svn 10 | then SVN=svn 11 | else SVN="$SCRIPT_PATH/svn" 12 | fi 13 | 14 | cd "$BUNDLES_PATH" 15 | LC_CTYPE=en_US.UTF-8 "$SVN" up *.tmbundle --no-auth-cache --non-interactive 16 | 17 | if [[ $? == 0 ]]; then 18 | if ps -xcU $USER|grep -sq "TextMate"; then 19 | osascript -e 'tell app "TextMate" to reload bundles' 20 | fi 21 | "$DIALOG_PATH" bubble --title 'All Bundles Updated' --text 'All your TextMate Bundles have been updated!' --icon-file "$SCRIPT_PATH/../Textmate.icns" 22 | else 23 | "$DIALOG_PATH" bubble --title 'There was a problem' --text "Wasn't able to update your TextMate Bundles" --icon-file "$SCRIPT_PATH/../Textmate.icns" 24 | fi 25 | 26 | LC_CTYPE=en_US.UTF-8 "$SVN" up "$SUPPORT_PATH" -------------------------------------------------------------------------------- /Commands/Update Installed Bundles.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | command 6 | 7 | SVN="${TM_BUNDLE_SUPPORT}/bin/svn" 8 | 9 | REV=$(< "$TM_SUPPORT_PATH/version") 10 | SVN_OPTS="-r$REV --no-auth-cache --non-interactive" 11 | 12 | cd ~/Library/Application\ Support/TextMate/Pristine\ Copy/Bundles 13 | if [[ $? == 0 ]]; then 14 | for f in *.tmbundle; do "$SVN" up $SVN_OPTS "$f"; done \ 15 | 2> >(CocoaDialog progressbar --indeterminate --title 'Updating all your Bundles' --text 'This could take a while...') 16 | 17 | osascript -e 'tell app "TextMate" to reload bundles' 18 | "${TM_RUBY:-ruby}" -wKU "$TM_BUNDLE_SUPPORT/notify.rb" updated 19 | else 20 | "${TM_RUBY:-ruby}" -wKU "$TM_BUNDLE_SUPPORT/notify.rb" update_failed 21 | fi 22 | 23 | name 24 | Update Installed Bundles 25 | output 26 | discard 27 | uuid 28 | 667B3ED4-CA2B-402D-9445-904798AE1AA0 29 | 30 | 31 | -------------------------------------------------------------------------------- /Commands/List Installed Bundles.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | . "$TM_SUPPORT_PATH/lib/webpreview.sh" 9 | html_header "Installed Bundles" "GetBundle" 10 | require_cmd svnversion 11 | 12 | cat <<'HTML' 13 | <table class="pro_table" cellspacing="0" cellpadding="5"> 14 | <tr><th>Bundle Name</th><th>Revision</th></tr> 15 | HTML 16 | 17 | cd ~/Library/Application\ Support/TextMate/Pristine\ Copy/Bundles 18 | for f in *.tmbundle; do 19 | echo "<tr><td>${f%.tmbundle}</td><td>" 20 | svnversion "$f" 21 | echo "</td></tr>" 22 | done 23 | 24 | cat <<'HTML' 25 | </table> 26 | HTML 27 | html_footer 28 | 29 | input 30 | none 31 | name 32 | List Installed Bundles 33 | output 34 | showAsHTML 35 | uuid 36 | FBA5B6EB-2516-4940-9C8B-70645917F8BB 37 | 38 | 39 | -------------------------------------------------------------------------------- /Support/notify.rb: -------------------------------------------------------------------------------- 1 | #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby 2 | require "#{ENV['TM_SUPPORT_PATH']}/lib/textmate" 3 | # 4 | # if %x{ defaults read /System/Library/CoreServices/SystemVersion ProductVersion } =~ /\A10\.4/ 5 | # %x{"#{ENV['TM_BUNDLE_SUPPORT']}/bin/converter.sh"} 6 | # USE_MAC = 'mac/' 7 | # else 8 | USE_MAC = '' 9 | # end 10 | 11 | GROWL_TEST = ENV['TM_BUNDLE_SUPPORT'] + "/as/" + USE_MAC + "growl_test.scpt" 12 | REGISTER = ENV['TM_BUNDLE_SUPPORT'] + "/as/" + USE_MAC + "register.scpt" 13 | NOTIFY_INSTALLED = ENV['TM_BUNDLE_SUPPORT'] + "/as/" + USE_MAC + "installed.scpt" 14 | NOTIFY_UPDATED = ENV['TM_BUNDLE_SUPPORT'] + "/as/" + USE_MAC + "updated.scpt" 15 | NOTIFY_FAILED = ENV['TM_BUNDLE_SUPPORT'] + "/as/" + USE_MAC + "update_failed.scpt" 16 | 17 | growl = %x{osascript "#{GROWL_TEST}"} 18 | 19 | if growl = "true" 20 | 21 | %x{osascript "#{REGISTER}"} 22 | case ARGV[0] 23 | when 'installed' 24 | %x{osascript "#{NOTIFY_INSTALLED}" #{ARGV[1]}} 25 | when 'updated' 26 | %x{osascript "#{NOTIFY_UPDATED}"} 27 | when 'update_failed' 28 | %x{osascript "#{NOTIFY_FAILED}"} 29 | end 30 | 31 | else 32 | 33 | case ARGV[0] 34 | when 'installed' 35 | %x{CocoaDialog bubble --title "Installed Bundle: #{ARGV[1]}" --text 'You now can use the new Bundle' --icon-file "#{TextMate.app_path}/Contents/Resources/Textmate.icns"} 36 | when 'updated' 37 | %x{CocoaDialog bubble --title 'All Bundles Updated' --text 'You can use them now' --icon-file "#{TextMate.app_path}/Contents/Resources/Textmate.icns"} 38 | when 'update_failed' 39 | %x{CocoaDialog bubble --title 'Could not update your Bundles' --text 'Use \"Check your Internet Connection\".' --icon-file "#{TextMate.app_path}/Contents/Resources/Textmate.icns"} 40 | end 41 | 42 | end 43 | -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | contactEmailRot13 6 | fronfgvna.tenrffy@inyvqpbqr.ng 7 | contactName 8 | Sebastian Gräßl 9 | deleted 10 | 11 | D48CE60E-EE6E-495E-8473-A7FE9796F87F 12 | D48CE60E-EE6E-495E-8473-A7FE9796F87F 13 | 351E6A40-A0DA-4562-86B3-55FACF557429 14 | 351E6A40-A0DA-4562-86B3-55FACF557429 15 | 16 | description 17 | A bundle to <a href="http://github.com/textmate/getbundle.tmbundle">retrieve more bundles</a> from the subversion repository at svn.textmate.org. 18 | mainMenu 19 | 20 | items 21 | 22 | 19B3B518-4B71-4AD6-BC0B-7B5477ABD2D9 23 | 667B3ED4-CA2B-402D-9445-904798AE1AA0 24 | FBA5B6EB-2516-4940-9C8B-70645917F8BB 25 | ------------------------------------ 26 | A952F27C-2200-4C2C-ABC9-69BD36FF76DF 27 | E11461A2-B186-4278-9CB9-95AAC8D9D7C0 28 | ------------------------------------ 29 | 8C7398D7-1BC2-4F4D-9BA9-AE1520D764AD 30 | 31 | submenus 32 | 33 | 34 | name 35 | GetBundle 36 | ordering 37 | 38 | 19B3B518-4B71-4AD6-BC0B-7B5477ABD2D9 39 | FBA5B6EB-2516-4940-9C8B-70645917F8BB 40 | 667B3ED4-CA2B-402D-9445-904798AE1AA0 41 | A952F27C-2200-4C2C-ABC9-69BD36FF76DF 42 | E11461A2-B186-4278-9CB9-95AAC8D9D7C0 43 | 44 | uuid 45 | 67CBC425-6A5B-4621-97A1-147C8CEC221C 46 | 47 | 48 | -------------------------------------------------------------------------------- /Commands/Install AutoUpdater.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | mkdir -p ~/Library/LaunchAgents/ 9 | 10 | cd ~/Library/Application\ Support/TextMate/Support 11 | if [[ $? == 0 ]]; 12 | then 13 | svn up . --no-auth-cache --non-interactive 14 | else 15 | mkdir ~/Library/Application\ Support/TextMate/Support 16 | svn co http://svn.textmate.org/trunk/Support/ ~/Library/Application\ Support/TextMate/Support --no-auth-cache --non-interactive 17 | fi 18 | 19 | $(cat <<EOF > ~/Library/LaunchAgents/com.macromates.textmate.bundleupdate.plist 20 | <?xml version="1.0" encoding="UTF-8"?> 21 | <!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN 22 | http://www.apple.com/DTDs/PropertyList-1.0.dtd > 23 | <plist version="1.0"> 24 | <dict> 25 | <key>Label</key> 26 | <string>com.macromates.textmate.bundleupdate</string> 27 | <key>Program</key> 28 | <string>$TM_BUNDLE_SUPPORT/bin/autoupdate.sh</string> 29 | <key>RunAtLoad</key> 30 | <true/> 31 | <key>StartCalendarInterval</key> 32 | <dict> 33 | <key>Hour</key> 34 | <integer>12</integer> 35 | <key>Minute</key> 36 | <integer>15</integer> 37 | </dict> 38 | </dict> 39 | </plist> ) 40 | 41 | { launchctl load ~/Library/LaunchAgents/com.macromates.textmate.bundleupdate.plist } &>/dev/console & 42 | 43 | input 44 | none 45 | name 46 | Install AutoUpdater 47 | output 48 | discard 49 | uuid 50 | A952F27C-2200-4C2C-ABC9-69BD36FF76DF 51 | 52 | 53 | -------------------------------------------------------------------------------- /Commands/Install Bundle.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | command 6 | 7 | PTRN=$(ruby -rtextmate -e 'print Dir.entries(TextMate.app_path + "/Contents/SharedSupport/Bundles").grep(/.tmbundle$/).join("|")') 8 | INST=$(ruby -rtextmate -e 'print Dir.entries( File.expand_path("~/Library/Application Support/TextMate/Pristine Copy/Bundles")).grep(/.tmbundle$/).join("|")') 9 | 10 | SVN="${TM_BUNDLE_SUPPORT}/bin/svn" 11 | 12 | REV=$(< "$TM_SUPPORT_PATH/version") 13 | SVN_OPTS="-r$REV --no-auth-cache --non-interactive" 14 | 15 | BASE_URL=http://svn.textmate.org/trunk/ 16 | 17 | bundlelist (){ 18 | eval '"$SVN"' list "$SVN_OPTS" '"${BASE_URL}/Bundles/"' \ 19 | | egrep -v "^($PTRN|$INST)/\$" \ 20 | | egrep -v "^GetBundle\.tmbundle" \ 21 | | sed -ne 's/.tmbundle\/$//p' \ 22 | | sort -f \ 23 | 3> >(CocoaDialog progressbar --indeterminate --title 'Getting Bundle List' --text 'This could take a while...') 24 | } 25 | IFS=$'\n' 26 | bundle=$(CocoaDialog dropdown \ 27 | --title 'Choose a Bundle' \ 28 | --text 'Select from list:' \ 29 | --button1 Install --button2 Cancel \ 30 | --string-output --no-newline \ 31 | --items $(bundlelist)) 32 | 33 | if [[ "${bundle:0:7}" == "Install" ]]; 34 | then bu=${bundle:8} 35 | else exit_discard 36 | fi 37 | 38 | mkdir -p ~/Library/Application\ Support/TextMate/Pristine\ Copy/Bundles 39 | cd ~/Library/Application\ Support/TextMate/Pristine\ Copy/Bundles 40 | 41 | eval '"$SVN"' co "$SVN_OPTS" '"${BASE_URL}/Bundles/${bu}.tmbundle"' \ 42 | 2> >(CocoaDialog progressbar --indeterminate --title "Installing Bundle: ${bu}" --text 'This could take a while...') 43 | 44 | if [[ $? == 0 ]]; then 45 | osascript -e 'tell app "TextMate" to reload bundles' 46 | "${TM_RUBY:-ruby}" -wKU "$TM_BUNDLE_SUPPORT/notify.rb" installed "${bu}" 47 | fi 48 | 49 | input 50 | none 51 | name 52 | Install Bundle 53 | output 54 | discard 55 | uuid 56 | 19B3B518-4B71-4AD6-BC0B-7B5477ABD2D9 57 | 58 | 59 | -------------------------------------------------------------------------------- /Support/show_bundles.rb: -------------------------------------------------------------------------------- 1 | #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU 2 | # encoding: utf-8 3 | 4 | SUPPORT = ENV['TM_SUPPORT_PATH'] 5 | require SUPPORT + '/lib/escape.rb' 6 | require SUPPORT + '/lib/osx/plist' 7 | require 'rexml/document' 8 | require 'erb' 9 | 10 | include ERB::Util 11 | 12 | DIALOG = e_sh ENV['DIALOG']; 13 | NIB = 'Bundles' 14 | 15 | def strip_html(text) 16 | text.gsub(/<[^>]+>/, '') 17 | end 18 | 19 | params = { 20 | 'isBusy' => true, 21 | 'progressText' => 'Fetching List…', 22 | 'progressMinValue' => 0, 23 | 'progressIsIndeterminate' => true, 24 | 'bundles' => [ ] 25 | } 26 | 27 | token = %x{#{DIALOG} -a #{e_sh NIB} -p #{e_sh params.to_plist}} 28 | 29 | x = Thread.new do 30 | 31 | bundles = [ ] 32 | open("|svn list --xml http://svn.textmate.org/trunk/Bundles") do |io| 33 | 34 | doc = REXML::Document.new io 35 | doc.elements.to_a("//entry/name").each do |node| 36 | bundles << { 'name' => $1, 'path' => $& } if node.text =~ /^(.*)\.tmbundle$/ 37 | end 38 | 39 | params['bundles'] = bundles 40 | params['isBusy'] = true 41 | params['progressText'] = "Fetching Descriptions (1 / #{bundles.size})…" 42 | params['progressValue'] = 0 43 | params['progressMinValue'] = 0 44 | params['progressMaxValue'] = bundles.size 45 | params['progressIsIndeterminate'] = false 46 | 47 | open("|#{DIALOG} -t#{token}", "w") { |dialog| dialog.write params.to_plist } 48 | params['isBusy'] = true 49 | 50 | bundles.each do |bundle| 51 | puts "Load #{bundle['path']}…" 52 | plist = open("|svn cat http://svn.textmate.org/trunk/Bundles/#{url_encode bundle['path']}/info.plist") do |svn| 53 | OSX::PropertyList.load(svn) 54 | end 55 | # puts "Got #{plist}" 56 | bundle['uuid'] = plist['uuid'] unless plist['uuid'].nil? 57 | bundle['name'] = plist['name'] unless plist['name'].nil? 58 | bundle['bundleDescription'] = strip_html plist['description'].to_s 59 | params['progressValue'] += 1 60 | params['progressText'] = "Fetching Descriptions (#{params['progressValue'] + 1} / #{bundles.size})…" 61 | open("|#{DIALOG} -t#{token}", "w") { |dialog| dialog.write params.to_plist } 62 | end 63 | 64 | end 65 | 66 | end 67 | 68 | res = %x{#{DIALOG} -w#{token}} 69 | open("/dev/console", "w") { |io| io.write res } 70 | %x{#{DIALOG} -x#{token}} 71 | 72 | x.kill; x.join 73 | --------------------------------------------------------------------------------