问题
I am trying to update all of my Textmate bundles to the most current version. Is there a way to do this without doing each bundle individually? If not how do I update an individual bundle? I don't know how to use svn so I would prefer to use the git repository.
Thanks for helping a noob! :)
回答1:
You can install the "Get Bundles" (with an "s" not "Get Bundle"--that's a different Bundle) Bundle
To install:
cd ~/Library/Application\ Support/TextMate/Bundles
svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/
(Alternatively, you can grab the "Get Bundles" Bundle from git.)
Once installed, you probably need to re-start TextMate.
Next, click "Bundles" in the Menu Bar, then click "Get Bundles" which will bring up a small sub-menu;
Click "Get Bundles" in that sub-menu.
This will bring up the Get Bundles GUI. In the upper left-hand corner are four buttons that refer to four different repositories ("Official", "Review", "3rd Party", and "All").
Click the right-most button "All"
In the bottom left-hand cornder of the GUI, click the "gear menu" which will bring up a menu, click "Install all Updates" from that menu (also accessible with cmd-U).
回答2:
If you don't want to go the Get Bundles route (and there's no reason not to per se, but I thought I'd provide an alternative), here's a script I use to manage my bundles:
#!/usr/bin/env ruby
Dir.glob('*.tmbundle') do |bundle|
bundle =~ /^(.*)\.tmbundle$/
puts "=> Updating #{$1}:"
if File.exists? "#{bundle}/.svn"
system %Q/cd "#{bundle}" && svn update/
elsif File.exists? "#{bundle}/.git"
system %Q/cd "#{bundle}" && git pull/
else
$stderr.puts 'Unknown version control system, skipping'
end
end
I threw this in /Library/Application Support/TextMate/Bundles
. Whenever I want to update all my bundles, I navigate there and run it. It loops through each bundle and updates via the appropriate version control mechanism (Subversion or Git).
回答3:
You have various scripts out there to help deal with the recursive aspect of submodules:
- batch script
- perl script for recursive update
- shell script
- git clone script with submodules
Plus the git submodules commands have now a recursive option attached to them.
来源:https://stackoverflow.com/questions/2483389/is-there-a-method-to-update-all-of-my-textmate-bundles-at-once-from-the-git-repo