Skip to content

Commit

Permalink
Add bundle updater
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Jarvis committed Sep 16, 2015
1 parent 4d9955c commit 80e6330
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions update_bundles
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 80e6330

Please sign in to comment.