54863f2e1b
Two new command line tools: yadr-vim-remove-plugin and yadr-vim-list-plugin do what they're supposed to.
31 lines
1.0 KiB
Ruby
Executable File
31 lines
1.0 KiB
Ruby
Executable File
#!/usr/bin/env ruby
|
|
require File.join(File.dirname(__FILE__), 'default_libs')
|
|
require File.join(File.dirname(__FILE__), 'vundle')
|
|
|
|
GitStyleBinary.command do
|
|
version "yadr-delete-vim-plugin 1.0"
|
|
|
|
short_desc "Removes a vim plugin"
|
|
opt :url, "Repository URL (see usage)", :required => true, :type => String
|
|
|
|
banner <<-'EOS'
|
|
Usage: yadr-delete-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
|
|
run do |command|
|
|
repo=command.opts[:url]
|
|
puts "Removing \"#{repo}\" from the plugin list"
|
|
bundle_path=repo.gsub("https://github.com/", "")
|
|
removed=Vundle::remove_plugin_from_vundle repo
|
|
if removed
|
|
Vundle::update_vundle
|
|
puts "Successfully removed\"#{repo}\""
|
|
else
|
|
puts "Unable to find \"#{repo}\" among the installed plugins"
|
|
end
|
|
end
|
|
end
|