-
Notifications
You must be signed in to change notification settings - Fork 2
/
update_bundles.rb.orig
executable file
·148 lines (135 loc) · 5.36 KB
/
update_bundles.rb.orig
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#!/usr/bin/env ruby
git_bundles = [
#"https://github.com/astashov/vim-ruby-debugger.git",
<<<<<<< HEAD
=======
"https://github.com/sheerun/vim-polyglot.git", # 606 packages covers all the common syntax
>>>>>>> b25cc8f (move common to vim-polyglot)
"https://github.com/msanders/snipmate.vim.git",
#"https://github.com/scrooloose/nerdtree.git",
#use wycats modified janus nerdtree
"https://github.com/wycats/nerdtree.git",
<<<<<<< HEAD
"https://github.com/timcharper/textile.vim.git",
"https://github.com/tpope/vim-cucumber.git",
"https://github.com/tpope/vim-fugitive.git",
"https://github.com/tpope/vim-git.git",
"https://github.com/tpope/vim-haml.git",
"https://github.com/tpope/vim-markdown.git",
=======
#"https://github.com/timcharper/textile.vim.git",
#"https://github.com/tpope/vim-cucumber.git",
"https://github.com/tpope/vim-fugitive.git",
#"https://github.com/tpope/vim-git.git",
#"https://github.com/tpope/vim-haml.git",
#"https://github.com/tpope/vim-markdown.git",
>>>>>>> b25cc8f (move common to vim-polyglot)
"https://github.com/tpope/vim-rails.git",
"https://github.com/tpope/vim-repeat.git",
"https://github.com/tpope/vim-surround.git",
"https://github.com/tpope/vim-vividchalk.git",
"https://github.com/tsaleh/vim-align.git",
<<<<<<< HEAD
#"https://github.com/tsaleh/vim-shoulda.git",
"https://github.com/tsaleh/vim-supertab.git",
#"https://github.com/tsaleh/vim-tcomment.git",
"https://github.com/vim-scripts/tComment.git",
"https://github.com/vim-ruby/vim-ruby.git",
"https://github.com/altercation/vim-colors-solarized.git",
"https://github.com/tpope/vim-unimpaired.git",
"https://github.com/kien/ctrlp.vim.git",
"https://github.com/derekwyatt/vim-scala.git",
"https://github.com/solarnz/thrift.git",
=======
"https://github.com/tsaleh/vim-shoulda.git",
"https://github.com/tsaleh/vim-supertab.git",
#"https://github.com/tsaleh/vim-tcomment.git",
"https://github.com/vim-scripts/tComment.git",
#"https://github.com/vim-ruby/vim-ruby.git",
"https://github.com/altercation/vim-colors-solarized.git",
"https://github.com/tpope/vim-unimpaired.git",
"https://github.com/kien/ctrlp.vim.git",
#"https://github.com/derekwyatt/vim-scala.git",
#"https://github.com/solarnz/thrift.git",
>>>>>>> b25cc8f (move common to vim-polyglot)
"https://github.com/mattn/webapi-vim.git",
"https://github.com/scrooloose/nerdcommenter.git",
"https://github.com/vim-scripts/L9.git",
"https://github.com/vim-scripts/jQuery.git",
"https://github.com/vim-scripts/dbext.vim.git",
"https://github.com/vim-scripts/bufexplorer.zip.git",
#"https://github.com/vim-scripts/vim-json-bundle.git",
<<<<<<< HEAD
"https://github.com/elzr/vim-json.git",
=======
#"https://github.com/elzr/vim-json.git",
>>>>>>> b25cc8f (move common to vim-polyglot)
"https://github.com/vim-scripts/pig.vim.git",
"https://github.com/vim-scripts/twilight.git",
"https://github.com/vim-scripts/vilight.vim.git",
"https://github.com/vim-scripts/jellybeans.vim.git",
<<<<<<< HEAD
"https://github.com/solarnz/thrift.vim.git",
"https://github.com/dln/avro-vim.git",
"https://github.com/mattn/gist-vim.git",
"https://github.com/leafgarland/typescript-vim.git",
"https://github.com/peitalin/vim-jsx-typescript.git"
=======
#"https://github.com/solarnz/thrift.vim.git",
"https://github.com/dln/avro-vim.git",
"https://github.com/mattn/gist-vim.git",
#"https://github.com/leafgarland/typescript-vim.git",
#"https://github.com/vim-scripts/bash-support.vim.git",
#"https://github.com/hdima/python-syntax.git",
#"https://github.com/peitalin/vim-jsx-typescript.git"
>>>>>>> b25cc8f (move common to vim-polyglot)
]
vim_org_scripts = [
#["IndexedSearch", "7062", "plugin"],
#["gist", "18053", "zip"],
#["fuzzyfinder", "13961", "zip"],
#["json", "10853", "syntax"],
]
other_scripts = [
# ["thrift", "http://svn.apache.org/repos/asf/thrift/trunk/contrib/thrift.vim", "syntax"],
#["avro-idl", "http://svn.apache.org/repos/asf/avro/trunk/share/editors/avro-idl.vim", "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|
# next unless should_update name
puts " Downloading #{name}"
local_file = File.join(name, script_type, "#{name}.#{script_type == 'zip' ? 'zip' : script_type == 'tar' ? 'tar': '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
if script_type == 'zip'
%x(unzip -d #{name} #{local_file})
end
if script_type == 'tar'
%x(mv #{local_file} #{name};cd #{name};tar xzvf *.tar)
end
end
other_scripts.each do |name, url, script_type|
# next unless should_update name
puts " Downloading #{name}"
local_file = File.join(name, script_type, "#{name}.#{script_type == 'zip' ? 'zip' : 'vim'}")
FileUtils.mkdir_p(File.dirname(local_file))
File.open(local_file, "w") do |file|
file << open(url).read
end
if script_type == 'zip'
%x(unzip -d #{name} #{local_file})
end
end