Skip to content

Instantly share code, notes, and snippets.

@basicxman
Created May 25, 2011 14:53
Show Gist options
  • Select an option

  • Save basicxman/991115 to your computer and use it in GitHub Desktop.

Select an option

Save basicxman/991115 to your computer and use it in GitHub Desktop.
Deletes any Vim plugins that aren't in config.json.
#!/usr/bin/env ruby
# Deletes any Vim plugins that aren't in config.json.
# For use with Pathogen.
require 'json/pure'
cur_dir = File.dirname(__FILE__) + "/"
repos = JSON.parse(File.read(cur_dir + "config.json"))
folders = repos.map { |r| r["folder"] }
Dir.entries(cur_dir).each do |dir|
if File.directory? dir and dir.index("vim-")
unless folders.include? dir
FileUtils.rm_rf cur_dir + dir
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment