lib/tmbundle.rb in tmbundle-manager-0.1.2 vs lib/tmbundle.rb in tmbundle-manager-0.1.3
- old
+ new
@@ -54,11 +54,15 @@
desc 'install USER/BUNDLE', 'Install a bundle from GitHub (e.g. tmb install elia/bundler)'
def install name
require 'tmbundle/bundle_name'
name = BundleName.new(name)
install_path = bundles_dir.join(name.install_name).to_s
- system('git', 'clone', name.git_url, install_path)
+ success = system('git', 'clone', name.git_url, install_path)
+ if not success
+ puts "attempting clone of #{name.alt_git_url}"
+ success = system('git', 'clone', name.alt_git_url, install_path)
+ end
end
desc 'path NAME', 'print path to bundle dir'
def path name
puts find_bundle(name).path
@@ -113,11 +117,12 @@
desc 'cd PARTIAL_NAME', 'open a terminal in the bundle dir'
def cd(partial_name)
bundle = find_bundle(partial_name)
within bundle do
- system 'open', bundle.path, '-a', 'Terminal.app'
+ term_program = ENV['TERM_PROGRAM'] || 'Terminal.app'
+ system 'open', bundle.path, '-a', term_program
end
end
@@ -159,10 +164,10 @@
def bundles_list
@bundles_list ||= BundlesList.new(bundles_dir)
end
def bundles_dir
- @bundles_dir ||= Pathname('~/Library/Application Support/Avian/Bundles').expand_path
+ @bundles_dir ||= Pathname('~/Library/Application Support/TextMate/Bundles').expand_path
end
class BundlesList < Struct.new(:dir)
def all
@all ||= Dir[dir.join('*/.git').to_s].map do |path|