2011-12-08 12:34:25 +08:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
require File.join(File.dirname(__FILE__), 'default_libs')
|
2013-03-18 01:10:55 +08:00
|
|
|
require File.join(File.dirname(__FILE__), 'vundle')
|
2011-12-08 12:34:25 +08:00
|
|
|
|
|
|
|
GitStyleBinary.command do
|
2012-01-25 15:04:37 +08:00
|
|
|
version "yadr-add-vim-plugin 1.0"
|
2011-12-08 12:34:25 +08:00
|
|
|
|
2013-03-18 01:10:55 +08:00
|
|
|
short_desc "Add a vim plugin from a repo"
|
2011-12-08 12:34:25 +08:00
|
|
|
|
2013-03-18 01:10:55 +08:00
|
|
|
opt :url, "Repository URL (see usage)", :required => true, :type => String
|
|
|
|
|
|
|
|
banner <<-'EOS'
|
|
|
|
Usage: yadr-add-vim-plugin --url [URL]
|
|
|
|
Specify a plugin repository URL in one of the following forms:
|
|
|
|
- Custom repository URL (full URL): git://git.wincent.com/command-t.git
|
|
|
|
- Github repository (username/repo_name): robgleesson/hammer.vim.git
|
|
|
|
- Vim script repository (plugin_name): FuzzyFinder
|
|
|
|
EOS
|
2011-12-08 12:34:25 +08:00
|
|
|
run do |command|
|
2013-03-18 01:10:55 +08:00
|
|
|
repo=command.opts[:url]
|
|
|
|
repo=command.opts[:url]
|
|
|
|
puts "Adding \"#{repo}\" to the plugin list"
|
|
|
|
bundle_path=repo.gsub("https://github.com/", "")
|
|
|
|
Vundle::add_plugin_to_vundle repo
|
|
|
|
Vundle::update_vundle
|
2011-12-08 12:34:25 +08:00
|
|
|
end
|
|
|
|
end
|