forked from rubenv/vimrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-bundles
executable file
·35 lines (28 loc) · 1019 Bytes
/
update-bundles
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env ruby
vim_org_scripts = [
#["javascript", "11838", "indent"],
]
require 'fileutils'
require 'open-uri'
vim_dir = File.dirname(File.absolute_path(__FILE__))
autoload_dir = File.join(vim_dir, "autoload")
bundles_dir = File.join(vim_dir, "bundle")
# Update pathogen
FileUtils.cd(autoload_dir)
puts "Updating pathogen"
`curl -o pathogen.vim https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim`
# Update git submodules
FileUtils.cd(vim_dir)
`git submodule foreach git checkout -q master`
puts `git submodule foreach git pull`
# Update boring old scripts that are not in git.
FileUtils.cd(bundles_dir)
vim_org_scripts.each do |name, script_id, script_type|
puts "Downloading #{name} from vim.org."
FileUtils.rm_rf 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