diff --git a/update_bundles b/update_bundles new file mode 100755 index 0000000..2941c9b --- /dev/null +++ b/update_bundles @@ -0,0 +1,42 @@ +#!/usr/bin/env ruby + +git_bundles = [ + "git://github.com/godlygeek/tabular.git", + "git://github.com/scrooloose/syntastic", + "git://github.com/rodjek/vim-puppet.git", + "https://github.com/bling/vim-airline", + "https://github.com/tpope/vim-fugitive", + "https://github.com/SirVer/ultisnips.git", + "https://github.com/honza/vim-snippets", +] + +vim_org_scripts = [ + ["IndexedSearch", "7062", "plugin"], + ["jquery", "12107", "syntax"], +] + +require 'fileutils' +require 'open-uri' + +bundles_dir = File.join(File.dirname(__FILE__), "bundle") + +FileUtils.cd(bundles_dir) + +puts "trashing everything (lookout!)" +Dir["*"].each {|d| FileUtils.rm_rf d } + +git_bundles.each do |url| + dir = url.split('/').last.sub(/\.git$/, '') + puts "unpacking #{url} into #{dir}" + `git clone #{url} #{dir}` + FileUtils.rm_rf(File.join(dir, ".git")) +end + +vim_org_scripts.each do |name, script_id, script_type| + puts "downloading #{name}" + local_file = File.join(name, script_type, "#{name}.vim") + FileUtils.mkdir_p(File.dirname(local_file)) + File.open(local_file, "w") do |file| + file << open("http://www.vim.org/scripts/download_script.php?src_id=#{script_id}").read + end +end