Created
May 25, 2011 14:53
-
-
Save basicxman/991115 to your computer and use it in GitHub Desktop.
Deletes any Vim plugins that aren't in config.json.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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